February 12th, 2009
Hello friends, the due to recent changes at way2sms, our SMS web service has undergone major changes.
If you had downloaded the PHP scripts or java library and if you are facing problems while sending SMS, try downloading the new version of the library at the relevant links below.
- SMS Web Service (PHP library + web service) – http://www.aswinanand.com/blog/2008/07/send-free-sms-web-service/
- Java Library to send SMS – http://www.aswinanand.com/blog/2009/01/free-sms-web-service-java-library/
Hope you enjoy using it.
July 17th, 2008
Update: There seems to be some problem when the API is being accessed from my domain. Kindly try hosting the script in your own domains.
Hi friends, if you are in India and if you are developing software prototypes which has to send SMS alerts to various Indian mobile numbers, you needn’t spend a lot to buy SMS credits at the various sites. Over the last weekend, I spent some time hacking up a quick SOAP based web service which you can consume in your programs.
Please note that you need to create an account at www.way2sms.com before proceeding further.
How to Use – Method 1:
Currently the web service is active at http://www.aswinanand.com/sendsms.php. This accepts four parameters.
|uid||This represents the 10 digit phone number with which you have to login at way2sms.
Note: This web service may not work if you try logging in with email address.
|pwd||Your way2sms password|
|phone||One or more phone numbers to which SMS has to be sent. Phone numbers should be separated by semicolon (;). E.g. 9812345678;9933445566|
|msg||Message that has to be sent.|
The URL – http://www.aswinanand.com/sendsms.php – can be invoked with the parameters as follows:
You can also do a HTTP POST to the same URL to send the SMS. Here’s an example:
<form method=”post” action=”http://www.aswinanand.com/sendsms.php“>
<input type=”hidden” name=”uid” value=”9933445566″ />
<input type=”hidden” name=”pwd” value=”password” />
<input type=”hidden” name=”phone” value=”9812345678;9933445566″ />
<input type=”hidden” name=”msg” value=”Hello World” />
<input type=”submit” value=”Send SMS” />
How to Use – Method 2:
The functionality is also exposed as a SOAP (Simple Object Access Protocol) WSDL (Web Service Description Language). WSDL can be accessed at http://www.aswinanand.com/sendsms.php?wsdl. To know more about how to use this WSDL in Microsoft Visual Studio, check out this article.
To deploy this SMS script on your own server, first download the source code & follow the instructions:
- Let us assume that you wish to run the service at http://www.example.com/sms/sendsms.php. Here, http://www.example.com/ is your domain, “sms” is the folder and “sendsms.php” is the PHP script in that folder.
- Hence, using FTP or SSH, login to your domain hosting space and create a folder named “sms”.
- Extract the source code to the “sms” folder. If you don’t want to expose a SOAP WSDL, feel free to skip to step 6.
- Since the SMS source code supports SOAP, you have to download the ‘nusoap’ library. Then extract the ‘nusoap’ library to the same “sms” folder.
- Once everything is extracted, the folder structure should be:
- htmlparser.inc (optional)
- Try accessing your web service at http://www.example.com/sms/sendsms.php now.
or you can also do a HTTP POST as indicated above.
The source code is licensed under “Creative Commons Attribution-Noncommercial”. Downloading the file(s) mean that you have agreed license terms.
Currently this SMS web service is available in the following programming languages:
If you liked this web service, please digg it . Kindly take it for a test drive and let me know if you find any bugs.
February 24th, 2006
hi!! guys, yesterday i developed a simple “Hello World!” webservice with java. With Netbeans 5.0 IDE its a breeze to create web services. It comes bundled with Apache Tomcat 5.5.9 and Sun Java Application Server 8.2.
You can find the quickstart tutorial here to develop web services. Just follow that tute and you will be fine. I will tell you how to consume the same using .net. I used Visual Studio 2005 to consume this service. I assume that you have the url for the wsdl of the webservice which should be similar to, http://localhost:8080/WebApplication1/NewWebService?WSDL.
1. Open Visual studio. “File->New->Website”. If using VS2003 then, “File->New->Project->ASP.NET Web Application”.
2. A web application should have been created by now and you have the “design view” of “default.aspx” or any other aspx page of your choice.
3. Press Ctrl+Alt+L or View->Solution Explorer. Right click on your project name and select “Add Web Reference”. In the windows that pops up, give the WSDL url and an “Instance Name”. My instance name was “JavaAdd”.
4. Add a button and a label to the asp.net page. Double click the button and paste the following code.
Dim js As New JavaAdd.NewWebService()
Dim myadd As New JavaAdd.add()
Dim myaddRes As New JavaAdd.addResponse()
myadd.int_1 = 10
myadd.int_2 = 10
myaddRes = js.add(myadd)
Label1.Text = myaddRes.result
JavaAdd.NewWebService js = new JavaAdd.NewWebService();
JavaAdd.add myadd = new JavaAdd.add();
JavaAdd.addResponse myaddRes=new JavaAdd.addResponse(); myadd.int_1=10;
Instead of “sayHi” method in the quickstart tute, i created a method called “add” which accepts 2 integer parameters and returns an integer after adding them up.
5. Press F5 now. You should get something similar to these.
Thats it for this post…bye!