How to Convert an SNPP request to HTTP request

Hi Experts,

   I have a serlvet which process an HTTP request, but the request which i'm goin to receive is off SNPP.

But we don't have an SNPP server to get the request,so how do am I process the SNPP request?

Is there any way to convert an SNPP request to HTTP or any way to write a code so that it could accept the SNPP request??

Similarly the response should be sent is off SNPP.

Can U experts provide sample code or sites on this.

Waiting for Ur reply...
TensionAsked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
> The Java application which is responsible for converting
> SMPP Request to HTTP Request

And as I said above you need to write an SMPP server.
0
 
objectsCommented:
I'm confused.
Do you want to know how to make a HTTP server accept SNPP requests?
0
 
objectsCommented:
You can certainly send and recieve SNPP using a servlet but the SNPP packets will need to wrapped in a HTTP packet.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
TensionAuthor Commented:
Hi objects,

   Thankx for Ur reply.

So how it could be done [SNPP packets will need to wrapped in a HTTP packet.]

Can U explain me in a detail manner?

0
 
objectsCommented:
It depends on what you're trying to do.
Can u explain in a bit more detail what you want to do?



0
 
TensionAuthor Commented:

Sorry, the protocol is off SMPP.

Actually a request is made from a mobile phone to know the stock status [AOL] which would be send to the cellular provider.

The provider then sends the redirects the request came from the mobile user [MobileNumber & StockName] which in the form of SMPP request.

We have a servlet which is based on HTTP request [Handle HTTP Request]which is goin to process the mobile request.

So how could the process been done to wrap SMPP packet to HTTP packet.So that the servlet could process the request & send the appropriate info. [Reverse should also be done, again from HTTP packets to SMPP packets so that the provider is able to get the response from the servlet & can be give to appropriate mobile user].

0
 
objectsCommented:
You need to have an SMPP server to recieve SMPP requests, web server is expecting HTTP packets and wouldn't know what to do with an SMPP packet.

Your servlet could certainly send SMPP packets use a socket connection with a SMPP server.
0
 
sghosh092199Commented:
Hi!

You can do the same in the following way:

Step 1: Parse the SMPP Packet and get the stock symbol


Step 2: Open a connection to the Servlet URL and provide the symbol information

try
          {
          URL url = new URL("http://smpp.domain.com/StockServlet");
          URLConnection connection = url.openConnection();
          connection.setDoOutput(true);

          PrintWriter out = new PrintWriter(
                              connection.getOutputStream());
          out.println("stock=" + stockSymbol);
          out.close();

Step 3: Read the information from Servet

          BufferedReader in = new BufferedReader(
                    new InputStreamReader(
                    connection.getInputStream()));
          String inputLine;

          while ((inputLine = in.readLine()) != null)
              System.out.println(inputLine);

          in.close();
   
          }
          catch (MalformedURLException e)
          {
          e.printStackTrace();
          }
          catch (IOException e)
          {
          e.printStackTrace();
          }




Step 4: Create a SMPP Packet incorporating information available from Servlet and connect to SMPP Server.


Hope that helps!
0
 
objectsCommented:
> Step 1: Parse the SMPP Packet and get the stock symbol

How do you recieve the SMPP packet though?
0
 
sghosh092199Commented:
As you have said, the servlet could certainly send SMPP packets with a socket connection to a SMPP server. Similarly, a socket connection can read from the Server too. I assume that it is a stream of bytes which can be parsed following the packet specifications.

0
 
objectsCommented:
> Similarly, a socket connection can read from the Server

But the server does not need to queried for the SMPP packet.
It is sending out SMPP packets, to (I assume) some address which needs to be an SMPP server.
Servets recieve requests thru the web server which supports HTTP.
0
 
TensionAuthor Commented:
Hi All!!
 
    Actually process is,the service provider accepts the request from the mobile user and provider redirects the request[is Off SMPP] to our servlet which is off [HTTP based].

sqhosh says that we can make a URL connection,I couldn't get this,Becoz the URL connection is made to a servlet.U mean to say that we have to query the SMPP server for getting the request?? how could it be done?

Becoz as objects says is correct, that he sends the request which is off SMPP to a servlet which supports HTTP.

sqhosh can U explain me bit more detail!!  
0
 
sghosh092199Connect With a Mentor Commented:
The Java application which is responsible for converting SMPP Request to HTTP Request, is mediating between the provider and the HTTP based Servlet.The SMPP Packets should be made available to this Java application. It can be done by opening a Socket and intercepting the output port in the SMPP Server, which is sending out SMPP request .

The idea behind opening a URL Connection to the Servlet is making a HTTP Request to the Servlet from the Java application. Web Server does make HTTP Requests to Servlet. But this scenario does not allow a Web Server to do so.

Hope I am bit clear!
0
 
CleanupPingCommented:
Tension:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
VenabiliCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Split points between objects and sghosh

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venabili
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.