Problem in responding to PPG server from servlet
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   vadi_velan
Posted On:   Saturday, December 11, 2004 08:47 AM

Hi, First let me to explain the system i am developing. Purpose of the System: A mobile needs to access the emails in a email server. Involved Systems: A mobile phone PushProxyGateway (PPG, A server capable of handling http and wap content) Content Provider ( who finally going to handle the request coming from PPG and connect to mailserver,fetch the email, give the mail content back to PPG) Work Flow: 1.Mobile send a request(mail server id, password) to PPG (To access email) 2.PPG receives the WAP (OTA) request and convert into Http request. 3.PPG forward the Http request to content provider. 4.Content provider access the mail serv   More>>

Hi,

First let me to explain the system i am developing.

Purpose of the System:
A mobile needs to access the emails in a email server.

Involved Systems:
A mobile phone
PushProxyGateway (PPG, A server capable of handling http and wap content)
Content Provider ( who finally going to handle the request coming from PPG and connect to mailserver,fetch the email, give the mail content back to PPG)

Work Flow:

1.Mobile send a request(mail server id, password) to PPG (To access email)

2.PPG receives the WAP (OTA) request and convert into Http request.

3.PPG forward the Http request to content provider.

4.Content provider access the mail server based on the information(email id,password,mail server id)received from mobile user.

5.Content Provider (CP) respond the email content back to PPG as Http Response.

6.PPG forward the HttpResponse as Wap response the mobile client.

Now in step 5, if the content provider sends the response as "Http Response" then PPG works fine. But It won't give any delivery confirmation(Whether the content delivered to mobile client or not). To receive the delivery confirmation I have to Push the mail content with PUSH-PAP Header (included below)to a particular port say 5050 of the PPG.

Format of the PUSH-PAP header with content :

POST /dummy.jsp HTTP/1.1
Host: server
Content-Type: multipart/related; boundary=asdlfkjiurwghasf;
type="application/xml"
Content-Length: 804
X-WAP-Payment-Info: content-value-class=167
--asdlfkjiurwghasf
Content-Type: application/xml
<?xml version="1.0"?>

"http://www.wapforum.org/DTD/pap_2.0.dtd">


push-id="9fjeo39jf084@content-provider.com"
ppg-notify-requested-to="www.content-provider.com:8080/pushapp.jsp">





--asdlfkjiurwghasf
Content-Type: text/vnd.wap.wml
<?xml version="1.0" encoding="UTF-8" ?>

"http://www.ABC.com/DTD/ABC-WML4.0.dtd">



Hello you got mail from John




--asdlfkjiurwghasf

Now I have to deliver the above content as it is (including line break) to PPG server's Port 5050 from a servlet.

I tried two mechanism :
Mechanism 1:
After setting the appropriate headers with the help of response.setHeader(), I given the respone using printwriter.write() method. But the problem is my PPG server treat those content as ordinary http content. Doesn't treat as Push Content. So i am unable to receive any delivery confirmation.

Mechanism 2:
I created socket copnnection to PPG Server and push the mail content through that socket. Now the PPG server accept it as push content, deliver it to mobile and give a delivery confirmation. Now the problem is : Mobile sent the Http Request through PPG and continuously waiting for that reply instead of accepting the response from a new connection(socket).. After the timeout period mobile says no response from the server.

My doubt is

1.In mechanism 1 - How can i send data from a servlet (in apache tomcat) without Http Wrappers on it ( i guess this wrapper is automatically inserted by apache tomcat server when using response.write(). Even though i set appropriate content type). A seperate socket connection won't work.

2.In mechanism 2 - how can i connect the socket connection (created in a java program or in servlet) to ServletResponse so that i can deliver the PUSH-PAP content in the same response. If i send like this, then mobile will get the push content in the same connection, instead of a different socket connection.

Your help will be greatly appreciated.

With thanks & regards
Vadivelan.R.    <<Less
About | Sitemap | Contact