• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

send and receive sms from servlet application

 
Ranch Hand
Posts: 355
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a project which consists of the delivery of an sms containing the national identification number of a user upon request. This request will be in the form of an sms. Say for instance a client sends an sms to the mobile operator, my app would retrieve the national id and communicates it to the mobile operator which would send it the client.
I have downloaded and installed kannel as well the smsc simulator SMPPSim and also gone through some of the documentation. Now my problem is, how can i simulate the reception of an sms? Say for instance a client sends 'nidn 5', i want to be able to take 5 and process it in a servlet to retrieve the associated national identification number. I need directions on how to achieve this.





 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stop thinking servlet until you have the functionality running in a separate class.

Your test situation could be as simple as a main() method in your class that takes a number from the command line and does the lookup.

After that is working, input of a number from a web page form to a servlet should be trivial.

Bill
 
Paul Ngom
Ranch Hand
Posts: 355
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi William,
I am not going to use a web page to input the number but an sms.





 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Ngom wrote:Hi William,
I am not going to use a web page to input the number but an sms.



Ah, I did not understand the data flow - in fact I still don't understand the data flow. So why is a servlet involved at all? What happens to the retrieved id number?

Bill
 
Paul Ngom
Ranch Hand
Posts: 355
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Servlet will connect to a database and return the national Id. Here is the process flow:
A client sends an SMS say 'nidn 5'
|
|
|
The telecom provider receives it and there must be some way to communicate it to my Servlet app. This is where the Sms gateway kannel comes in. It interfaces between the smsc and the app.
|
|
|
After retrieval of the Id by the Servlet, the information is given back to kannel which in turn route it to the smsc and the Sms is delivered to the client.






 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The Servlet will connect to a database and return the national Id. Here is the process flow:



I still see no reason for a servlet to be involved at all - servlets and web servers exist to handle HTTP requests and create responses.

I don't see any HTTP request or response being generated. What in the servlet API is required in this scenario?

You seem to be describing a stand alone application that is always running, knows how to talk to a database and how to deal with SMS messages.

The only similarity to a web service is that it is always running, responds to messages, and needs to be able handle multiple messages "at the same time" without mixing them up. Servlet architecture may be an inspiration to your design but thats about the extent of it.

Bill
 
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!