• Post Reply Bookmark Topic Watch Topic
  • New Topic

send and receive sms from servlet application  RSS feed

 
Paul Ngom
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.





 
William Brogden
Author and all-around good cowpoke
Rancher
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
Rancher
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
Rancher
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!