Java application to receive sms | Search |
NowSMS Support Forums ⬆ NowSMS Support - SMS Issues ⬆ Archive through July 28, 2014 ⬆ |
◄ ► |
Author | Message | |||
hamze ibraheem al sarousr New member Username: Hamze85 Post Number: 4 Registered: 02-2014 |
hello i want a java code to receive sms and response to it in java using nowsms can any one help me please? | |||
hamze ibraheem al sarousr New member Username: Hamze85 Post Number: 6 Registered: 02-2014 |
hello i want although an code to receive ussd massage using nowsms please help me | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 4821 Registered: 08-2008 |
Hi, We do not have any java examples for receiving SMS. When NowSMS receives an SMS message, it can then either connect to an HTTP URL to process the message, or it can run a local command to process the message. To pass the message to an application over HTTP, you'd define a 2-way command with a URL of something like http://server/path?sender=@@SENDER@@&text=@@TEXT@@ Let's say that you received an SMS message from "123456789" with text of "test message". NowSMS would issue the following 2-way command: http://server/path?sender=1234567890&text=test+message An HTTP server application would be able to pass the "sender" and "text" variables to obtain the details about the received message. If you're building this in Java, you'd probably create a Java servlet on your web server to process this received message. Obviously, you'd want to test your servlet with simple URL request examples like my example above ... before you went and activated it as a 2-way command. To send back a response, there are two different ways to do it. One way is to return a text response to the HTTP request. The MIME type of the response must be "text/plain". If the 2-way command is configured in NowSMS with "Command returns response text", then NowSMS looks for the HTTP response and sends a reply back with this text. The other way is to send a new message using the Java examples here: http://www.nowsms.com/nowsms-java-example-send-sms-message -- Des NowSMS Support | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 4822 Registered: 08-2008 |
I see your follow-up question asks about USSD instead of SMS. USSD is more complicated because there are different vendors that have built different ways of interfacing USSD to SMPP. NowSMS will only support USSD with an SMPP connection to a USSD service. See the following links for some information based on past customer experiences: http://www.nowsms.com/ussd-and-nowsms http://www.nowsms.com/ussd-and-nowsms-revisited |