Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
http://ntrrr:8800/PhoneNumber=0555291042&Text

What is the object/syntax to use in .NET to execute the command above after the user click the "SEND" button.

I am planning to put it in a web service so other application can run it.

Thanks
Posted

Do you want to access a web service method from an asp.net application?
Do you trying this for NowSMS / other SMS Gateway software... your given url example probably post sms using HTTP over TCP/IP..
 
Share this answer
 
v2
If you are putting this in a web service, you will need your web client to point to the server. E.g. http://xxx.xx.xx.xxx/PhoneNumber=0555291042%Text
where xxx.xx.xx.xxx is your IP.

Hope I understood your question correctly.
 
Share this answer
 
yes I am running from NOWSMS gateway. and I want to use the webservice. The problem Is I don't know the syntac or objec to use to run the http:// command
 
Share this answer
 
Thanks I've got the answer. Below is my solution.

protected void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                UriBuilder urlBuilder = new UriBuilder();
                urlBuilder.Host = "ntdbr.stc.corp";
                urlBuilder.Port = 8800;
                string PhoneNumber = "0555291042";
                string message = "Just a simple text Sending SMS failed: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Exception: Sending failed: Timeout. ";
                //urlBuilder.Query = string.Format("PhoneNumber=%2B" + PhoneNumber + "&Text=" + message);
                urlBuilder.Query = string.Format("?PhoneNumber=" + PhoneNumber + "&Text=" + message + "&Sender=Me");
                HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(urlBuilder.ToString(), false));
                HttpWebResponse httpResponse = (HttpWebResponse)(httpReq.GetResponse());
                Response.Write(httpResponse.StatusCode.ToString());
                Response.Write("sms send successfully"); 

            }
            catch (Exception errs)
            {
                Response.Write(errs.Message);
            }
           
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900