Sending SMS using Web Services

AjFication

New member
Joined
Apr 10, 2007
Messages
1
Programming Experience
Beginner
Tried to use the web service to send sms but could not it was showing the following error:

Error in Sending messageSystem.Net.WebException: The underlying connection was closed: Unable to connect to the remote server. at System.Net.HttpWebRequest.CheckFinalStatus() at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult) at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at SendSmS.net.webservicex.www.SendSMS.SendSMSToIndia(String MobileNumber, String FromEmailAddress, String Message) in c:\inetpub\wwwroot\SendSmS\Web References\net.webservicex.www\Reference.vb:line 42 at SendSmS.WebForm1.Send_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\SendSmS\WebForm1.aspx.vb:line 58


What could be the reason?

The webservice used was:
http://www.webservicex.net/SendSMS.asmx?WSDL


The code is something like this:

Private Sub Send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Send.Click
Try
Dim smsIndia As New net.webservicex.www.SendSMS
Dim smsWorld As New com.webservicex.www.SendSMSWorld
If rdoType.Checked = True Then
smsIndia.SendSMSToIndia(txtMobileNo.Text.Trim(), txtEmailId.Text.Trim(), txtMessage.Text)
Else
smsWorld.sendSMS(txtEmailId.Text.Trim(), txtCountryCode.Text.Trim(), txtMobileNo.Text.Trim(), txtMessage.Text)
lblMessage.Visible =
True
lblMessage.Text = "Message Sent Succesfully"
End If
Catch ex As Exception
lblMessage.Visible =
True
lblMessage.Text = "Error in Sending message" + ex.ToString()
End Try
End Sub
 
Hi

Hi AjFication,
I tried to send an sms but the status its returning is "Please enter correct from email address to send this message" eventhough i had provided a valid email address. Do i have to register? or do i have to assign the provider and state manually?

My test code is given below:

VB.NET:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim sms As New net.webservicex.www.SendSMS
        Dim smsResult As net.webservicex.www.SMSResult = sms.SendSMSToIndia("MyMobileNumber", "MyEmailAddress", "Sms from webservice")
        MessageBox.Show(smsResult.Status)
    End Sub
 
Back
Top