Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to Convert an SNPP request to HTTP request

Posted on 2001-08-22
15
Medium Priority
?
569 Views
Last Modified: 2008-03-10
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...
0
Comment
Question by:Tension
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
  • 3
  • +2
15 Comments
 
LVL 92

Expert Comment

by:objects
ID: 6416484
I'm confused.
Do you want to know how to make a HTTP server accept SNPP requests?
0
 
LVL 92

Expert Comment

by:objects
ID: 6416496
You can certainly send and recieve SNPP using a servlet but the SNPP packets will need to wrapped in a HTTP packet.
0
 

Author Comment

by:Tension
ID: 6416515
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 92

Expert Comment

by:objects
ID: 6416628
It depends on what you're trying to do.
Can u explain in a bit more detail what you want to do?



0
 

Author Comment

by:Tension
ID: 6416923

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
 
LVL 92

Expert Comment

by:objects
ID: 6416940
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
 
LVL 3

Expert Comment

by:sghosh092199
ID: 6419844
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
 
LVL 92

Expert Comment

by:objects
ID: 6420153
> Step 1: Parse the SMPP Packet and get the stock symbol

How do you recieve the SMPP packet though?
0
 
LVL 3

Expert Comment

by:sghosh092199
ID: 6420522
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
 
LVL 92

Expert Comment

by:objects
ID: 6420532
> 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
 

Author Comment

by:Tension
ID: 6420833
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
 
LVL 3

Assisted Solution

by:sghosh092199
sghosh092199 earned 400 total points
ID: 6421904
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
 
LVL 92

Accepted Solution

by:
objects earned 400 total points
ID: 6423943
> 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
 

Expert Comment

by:CleanupPing
ID: 9061798
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
 
LVL 20

Expert Comment

by:Venabili
ID: 9333052
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question