Home » Asp.net

send SMS using web service

hi.. i want to send sms using webservice of way2sms..

for that i use this code


Step 1: Add Web Reference : 
Step 2: Add This "using com.spiritssoft.www;"
Step 3: Create a Object "SendWay2Sms smsobj = new SendWay2Sms();"
Step 4:
        string strResult = smsobj.sendSmsSpiritsSoft("UserName", "Password", "Number", "message");
    strResult  : Recieving the Result from Webservice 

     - For Group SMS , Number seperated by commas(,).
     - Message should be Only 125 characters,
     - If No username , password form way2sms.com it will send message 
       through Spirits Soft Technology Default Number.

it was working well before few days... but now its not working now..

at http://www.spiritssoft.com/webservice/sendway2sms.asmx we dont find any web service..

here it provide web reference but its not working...

how does it possible.. i mean it was working fine before few days...

14 Answers Found


Answer 1


Most of SMS Services are paid Contact Your Service provider


Answer 3

its not so... before few days the way2sms was working well... but dont know y now not working !Frown


Answer 4


the link that you have suggested not working!


Answer 6

none of three links working


Answer 7


none of three links working

Again Contact Your Service Provider..


Answer 8

how to contact service  provider?? its free service i told you.. and it was working before few days


Answer 9

i found another way..

the web  service is updated here:


from that i found jar file and converted into .dll and added into my asp.net website..

its added and method are found form that bt at runtime it give this error:

Compilation Error Description: An error occurred during the compilation of a resource required to service  this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0012: The type 'java.lang.Object' is defined in an assembly that is not referenced. You must add  a reference  to assembly 'IKVM.OpenJDK.Core, Version=, Culture=neutral, PublicKeyToken=13235d27fcbfff58'.


Answer 10


how to contact service  provider?? its free service i told you.. and it was working before few days

Seems "spiritssoft.com" is down.... and go for any paid service.. it would Be better... It will cost and it is worth.


Answer 11



       Please send  me free web  service provide company its mini project for that i can't pay much amount please help and


send along with which namespace could include and class name  


Answer 12

Use This Code its work all Time

other Severcie are change the API



protected void Page_Load(object sender, EventArgs e)








  protected void Btesend_Click()





     sendSms(mbno, mseg);



public void connect()


        //ckuser = Session["id"].ToString();

        ckuser = "Your way2sms Regeistred Number";

        //ckpass = Session["pw"].ToString();

        ckpass = " Your way2sms Regeistred  Password";



            this.req = (HttpWebRequest)WebRequest.Create("http://wwwd.way2sms.com/auth.cl");

            this.req.CookieContainer = new CookieContainer();

            this.req.AllowAutoRedirect = false;

            this.req.Method = "POST";

            this.req.ContentType = "application/x-www-form-urlencoded";

            this.strNewValue = "username=" + ckuser + "&password=" + ckpass;

            this.req.ContentLength = this.strNewValue.Length;

            StreamWriter writer = new StreamWriter(this.req.GetRequestStream(), Encoding.ASCII);



            this.response = (HttpWebResponse)this.req.GetResponse();

            this.cookieCntr = this.req.CookieContainer;


            this.req = (HttpWebRequest)WebRequest.Create("http://wwwd.way2sms.com//jsp/InstantSMS.jsp?val=0");

            this.req.CookieContainer = this.cookieCntr;

            this.req.Method = "GET";

            this.response = (HttpWebResponse)this.req.GetResponse();

            responseee = new StreamReader(this.response.GetResponseStream()).ReadToEnd();

            int index = Regex.Match(responseee, "custf").Index;

            responseee = responseee.Substring(index, 0x12);

            responseee = responseee.Replace("\"", "").Replace(">", "").Trim();



            //pnlsend.Visible = true;

            lblErrormsg.Text = "connected";

            //lblError.Text = "connected";


        catch (Exception)


            //lblError.Text = "Error connecting to the server...";

            lblErrormsg.Text = "Error connecting to the server...";

            Session["error"] = "Error connecting to the server...";







    public void sendSms(string mbno, string  mseg)


        if ((mbno != "") && (mseg != ""))




                this.req = (HttpWebRequest)WebRequest.Create("http://wwwd.way2sms.com//FirstServletsms?custid=");

                this.req.AllowAutoRedirect = false;

                this.req.CookieContainer = this.cookieCntr;

                this.req.Method = "POST";

                this.req.ContentType = "application/x-www-form-urlencoded";

                this.strNewValue = "custid=undefined&HiddenAction=instantsms&Action=" + responseee + "&login=&pass=&MobNo=" + this.mbno + "&textArea=" + this.mseg;


                string msg = this.mseg;

                string mbeno = this.mbno;


                this.req.ContentLength = this.strNewValue.Length;

                StreamWriter writer = new StreamWriter(this.req.GetRequestStream(), Encoding.ASCII);



                this.response = (HttpWebResponse)this.req.GetResponse();



                lblErrormsg.Text = "Message Sent..... " + mbeno + ": " + msg;

                //lblError.Text = "Message Sent..... " + mbeno + ": " + msg;


            catch (Exception)


                lblErrormsg.Text = "Error Sending msg....check your connection...";

                //lblError.Text = "Error Sending msg....check your connection...";





            lblErrormsg.Text = "Mob no or msg missing";

            //lblError.Text = "Mob no or msg missing";




Answer 14

hi diya..

do u got solution of it ????

if yes please tell me..how ?

the code is not working of all three links



Dear Friends,

I want to send SMS from my web application.

My web app has a page where it takes a number and textarea to type the message to be sent.

Now this app is my laptop and it has to send the sms thru' my mobile.

The Laptop is connected to my mobile through Bluetooth(NOT Data cable).

How I can send the sms in this scenario?

If the laptop is coonected thru' datacable then would the code be different?

Thanks for your efforts.


Hi All,

we are developing a web application. we required to send SMS to the particular users, Is there any free sms gate ways are available?


Sorry for the dumb question, but trying to understand how SMS intercept will work on a device via a web service?  Our first app (CellF Locate) uses SMS intercepts to return location information for Mom's & Dad's wanting to keep tabs on their kids (e.g. via SMS and a PIN to daughter's phone).  Will Mom now have to have an app on her end that interacts with a web service that daughter's phone is registered to for the notification to get through?  Thanks.

I´ve written a small application that allows me to send SMS via a Webservice.
Now I would love to keep my sent messages as a history and it woukd be nice if they would appear in the Sent Folder of
the build in SMS Application (Outlook).
Is there a way to do that? I could not find anything regarding this topic, only how to send a SMS via Pocket Outlook but I only want to store a "fake" SMS in the Sent Folder.

Thank you



I need to call a web service with two input parameters from the Itinerary. The first input parameter is a message itself and second parameter is hardcoded based on which some operation is performed on message in webservice. I am not able to send the parameters to web service.

Please halp.




Dear Friends,

I am in trouble in creating an application that sends and receives sms using my cellphone connected to the computer(using a gsm modem). I just don't want to use a web service / third party applications that cost at all. Just like a simple c# windows application that sends and receive sms. I tried to explore google, codeproject, etc but they use web services, third party and gateways. And applications that I downloaded dont work at all.

I already installed the modem in my computer. What i am needing for now is the application.

Anybody can guide me...

In advance your help is appreciated. Thanks.



Now i am working in C#.NET application. I want to send sms from my application from sms gateway(Not mobile or modem). Please any one help me to send free sms from my C# application.

Thanks in advance.

Our service provider has a AXIS web service but I am using VB.Net. I need to develop a program to sign the xml file and send the signed xml file to the web service and get the result. Below is the Signed XML file & my VB codes. But the program stop at

resp = req.GetResponse()

and throw a message "500 interal server error". Am I using the correct way to send the signed xml file to AXIS web service.

******* Signed XML File **********

******** VB CODE ********************************

PrivateSub SendSOAP()
Dim vCertSubject AsString = "E=abc@qbc.com, CN=TestCert, O=ABC"

Dim vInXML AsString = "C:\InFile.xml"

Dim vOutXML AsString = "C:\SignedFile.xml"

SignXmlFile(vInXML, vOutXML, vCertSubject)

Dim xDoc AsNew System.Xml.XmlDocument

Dim bytes AsByte()
bytes = System.Text.Encoding.UTF8.GetBytes(xDoc.InnerXml)

Dim req As Net.HttpWebRequest = Net.WebRequest.Create("https://xyz.com/NCDRequest")
'req.Headers.Add("SOAPAction", "https://xyz.com/NCDRequest")
req.Headers.Add("SOAPAction", "urn:NCDServices" & "#" & "NCDRequest")

req.ContentType = "text/xml;charset=utf-8" req.Accept = "text/xml" req.Method = "POST"
Dim stm As IO.Stream
stm = req.GetRequestStream()
stm.Write(bytes, 0, bytes.Length)

Dim resp As Net.WebResponse
resp = req.GetResponse()
stm = resp.GetResponseStream()

Dim r AsNew IO.StreamReader(stm)
Me.TextBox1.Text = r.ReadToEnd()

' Sign an XML file and save the signature in a new file.
Sub SignXmlFile(ByVal FileName As String, ByVal SignedFileName As String, ByVal SubjectName AsString)
IfNothing = FileName ThenThrowNew ArgumentNullException("FileName")
EndIfIfNothing = SignedFileName ThenThrowNew ArgumentNullException("SignedFileName")
EndIfIfNothing = SubjectName ThenThrowNew ArgumentNullException("SubjectName")
EndIf' Load the certificate from the certificate store.
Dim cert As X509Certificate2 = GetCertificateBySubject(SubjectName)

' Create a new XML document.
Dim doc AsNew XmlDocument()

' Format the document to ignore white spaces.
doc.PreserveWhitespace = False
' Load the passed XML file using it's name.
doc.Load(New XmlTextReader(FileName))

' Create a SignedXml object.
Dim signedXml AsNew Xml.SignedXml(doc)

' Add the key to the SignedXml document.
signedXml.SigningKey = cert.PrivateKey

' Create a reference to be signed.
Dim reference AsNew Xml.Reference()
reference.Uri = "#Body"
' Add an enveloped transformation to the reference.
Dim env AsNew XmlDsigEnvelopedSignatureTransform()

' Add the reference to the SignedXml object.

' Create a new KeyInfo object.
Dim keyInfo AsNew KeyInfo()

' Load the certificate into a KeyInfoX509Data object
' and add it to the KeyInfo object.
' Create an X509IssuerSerial object and add it to the
' KeyInfoX509Data object.
Dim kdata AsNew KeyInfoX509Data(cert)

Dim xserial As X509IssuerSerial

xserial.IssuerName = cert.IssuerName.ToString()
xserial.SerialNumber = cert.SerialNumber

kdata.AddIssuerSerial(xserial.IssuerName, xserial.SerialNumber)


' Add the KeyInfo object to the SignedXml object.
signedXml.KeyInfo = keyInfo

' Compute the signature.

' Get the XML representation of the signature and save
' it to an XmlElement object.
Dim xmlDigitalSignature As XmlElement = signedXml.GetXml()

' Append the element to the XML document.
doc.DocumentElement.AppendChild(doc.ImportNode(xmlDigitalSignature, True))

IfTypeOf doc.FirstChild Is XmlDeclaration Then doc.RemoveChild(doc.FirstChild)
' Save the signed XML document to a file specified
' using the passed string.
Dim xmltw AsNew XmlTextWriter(SignedFileName, New UTF8Encoding(False))
Try doc.WriteTo(xmltw)

Finally xmltw.Close()


hello frnds........i would like to make an application in which users send a sms and than we rply back to it through the appropirate msg from our DB .i want to build this app via SMS gateway and not by using AT commands...........

can anyone guide me how to proceed,which namespaces to include for sending and receiving sms.PLEASE dont give me external link to codeproject,dot net spider or any other sites links because none of them satisfied me.


i want to make the server in c# as window server nt as a web server developed in asp.net.











I'm doing some research on the ability to send and receive SMS to and from a server.

The scenario is that - users would send the SMS to the server and the server will, after processing, send SMS to the appropriate number/numbers.

So far I have heard/seen solutions to this problem via GoogleForce, Tropo and 3Jam.

Being a Microsoft developer and the rest of the application designed on the Microsoft platform, I was wondering if anyone knows a Microsoft solution to this scenario? Maybe using Live Services or Office communicator.

Any help/direction will be greatly appreciated.

Hello everyone,
I am working on an application that receives an SMS and filters it on the phone. However, I am having difficulties by sending an SMS from the device to a predetermined email address just as an acknowledge that the device received the request.
I tried:

            OutlookSession session = new OutlookSession();
            EmailMessage email = new EmailMessage();
            email.To.Add(new Recipient("MObilee", "email@email"));
            email.Subject = "Request Acknoledged";
            email.BodyText = "The request was successfully acknowledged";

but without anyluck. I dont want to get into any email client procedure. Just how you can send a sms to an email, the way its possible that in your phone instead of sending a text message to "123456789" you can send it to "email@email.com".

Thank you!

We are really happy to present our incredible bulk SMS sending plan with fixed per message price, called DELTA. With DELTA plan you can send messages for only 0.02 EUR per SMS to any destination in the world.


For more information about DELTA plan, please visit our web-site: http://www.2-waysms.com/?page=delta


In case you would like, please feel free to open an account in our system:



It appears there used to be an action called PostURL that was removed in CRM 4.0.  Is there a way I can send data via HTTP POST to an external system?  If not, I envision using a custom web application in an IFrame.



Hi there,

Is there a way to set up PWA in order to send SMS alerts (for task assignments, task update, etc.) to a cell phone instead of/along with email alerts?

We are using Project 2007. We already have a website service provider for SMS. Just don’t know how to use it with PWA.

I found in this forum some links related to Sharepoint and SMS, but nothing about PWA and SMS.


Thanks in advance



 i am using AT command to send and recieving sms. I developed windows service to sensd sms at a time interval. Please clarify the following doubts

1. I need to save the send details in my database. Now i am thinking to save when i send the sms. But my doubt is "Is anyway to receive acknowledgement for successfully send ? " Can i save the detaiuls according to the acknoledge?

2. What are the difference between using AT command and SMS Gateway. Which one is best? and the limitations of AT commands. Some time message  not reached and sometime multiple message reached that all are in network related. All these in limitation

Hi guys

Any Idea how to send sms in sharepoint

i want it to be as web part



Can someone help me about this thing..

i know how to receive a data.. from sms.. using the service provider gateway.. but my problem is the reply of message from the source..

the instruction says


On your side, provision InfoBoard's dispatcher URL. It will be used in sending out reply messages. Access it including the GET parameters and make sure that settings are also follows. Dispatcher URL: http://theinfoboard-smart.net/gw/dispatcher.woof

GET Parameters:
RRN is the random reference number, it must be the same rrn as in Step 1.
SRC is the access code (i.e 7001) 
DST is the recipient of the message (i.e. 639209547958)
MSG is the actual reply message up to 420 characters, including non printable characters.
KYWRD is the primary keyword (i.e. infoboard)
Can someone explain to me how to do this?


I am a newbie in cpp.I have been using this code to load cemapi.dll to send sms from my pda which is using Windows Mobile 6.1

typedef struct sms_sending_info {

CString sDest;

CString sContent;


typedef int (__cdecl *SendSMSMessage)(LPCTSTR sDest, LPCTSTR sContent, BOOL bDeliveryReportRequest);

static BOOL SendSMS_WM(HMODULE hDll, CString sDest, CString sContent)


SendSMSMessage procSending = (SendSMSMessage)GetProcAddress(hDll, L"sendsmsmessage");



return ((procSending)(sDest, sContent, FALSE) == 0);


return FALSE;


static UINT ThreadSendSMS(LPVOID params)



HINSTANCE hDllHandle = LoadLibrary(L"cemapi.dll");

BOOL bRet;



bRet = SendSMS_WM(hDllHandle, info->sDest, info->sContent);





MessageBox(NULL, L"Send SMS failed!",L"Error!", MB_ICONINFORMATION | MB_OK);


}return S_OK;


static BOOL SendSMS(CString sDest, CString sContent)


int i = 0;


info->sDest = sDest;

info->sContent = sContent;

while((NULL == AfxBeginThread(AFX_THREADPROC(ThreadSendSMS), info)) && i < 3)




return (i!=3);

The function SendSMS_WM2k5() is being called (So I think the cemapi.dll is getting loaded)but the 'sendsmsmessage'  function is not getting loaded,so the sms is not being sent.What could be wrong here?


i want vb.net code to send or receive sms to mobile phone-GSM modem please guide me

Hi All,
I want to send SMS from my application i have tried alot but i don't fine any solution.Please help me out i really need this.I don't want to use any third party webservice or any third party tool like simplewire,i want to create my own web service,I don't expect any code from anybody but i will be very thankful if anybody share the logic behind this.I am working as vb.net developer but i haven't use mobile toolkit.Kindly give me the direction where i could start.
Please reply,i really need this.
Thanx in advance,


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure