Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
mikes2002
Posts: 18
Registered: ‎02-10-2009
My Device: Not Specified
Accepted Solution

PAP Status Query Issue

I have successfully sent a PAP message and want to query for the status using <statusquery-message>.  However when I send the message, the MDS simulator gives an error "bad PAP message: invalid push submission".  I am not sure what the deal is.  Does anyone have an idea what the issue is?  Here is a snipet of my code making the call.  Of course I actually use a valid push-id and address_value.

 

.... HttpURLConnection MDS_CONN = (HttpURLConnection) MDS_HOST_URL.openConnection(); MDS_CONN.setRequestProperty("Content-Type", "multipart/related; type=\"application/xml\"; boundary=" + boundary); MDS_CONN.setRequestProperty("X-Wap-Application-Id", "/"); MDS_CONN.setRequestProperty("X-Rim-Push-Dest-Port", DEVICE_PORT); MDS_CONN.setRequestMethod("POST"); MDS_CONN.setAllowUserInteraction(false); MDS_CONN.setDoInput(true); MDS_CONN.setDoOutput(true); String Message = ""; Message += "Content-Type: application/xml\r\n\r\n"; Message += "<?xml version=\"1.0\"?>\r\n"; Message += "<!DOCTYPE pap PUBLIC \"-//WAPFORUM//DTD PAP 2.0//EN\" \"http://www.wapforum.org/DTD/pap_2.0.dtd\">\r\n"; Message += "<pap>\r\n"; Message += "<statusquery-message push-id=\"a_push_id\">\r\n"; Message += "<address address-value=\"WAPPUSH=aisha.wahl%40blackberry.com%3A7874/TYPE=USER@rim.net\"/>\r\n"; Message += "</statusquery-message>\r\n"; Message += "</pap>\r\n"; .... This is what the message looks like: Content-Type: application/xml <?xml version="1.0"?> <!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.0//EN" "http://www.wapforum.org/DTD/pap_2.0.dtd"> <pap> <statusquery-message push-id="123@wapforum.org"> <address address-value="WAPPUSH=aisha.wahl%40blackberry.com%3A7874/TYPE=USER@rim.net"/> </statusquery-message> </pap>

 

BlackBerry Development Advisor
MSohm
Posts: 14,849
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: PAP Status Query Issue

[ Edited ]
The message looks valid.  What version of MDS Simulator are you testing on?  Are you able to query a pap push using the browserpushdemo included with the BlackBerry JDE?
Message Edited by MSohm on 04-15-2009 04:41 PM
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
mikes2002
Posts: 18
Registered: ‎02-10-2009
My Device: Not Specified

Re: PAP Status Query Issue

Thanks I figured it out.  Here is how it should look instead of my original code that I posted.

 

HttpURLConnection MDS_CONN = (HttpURLConnection) MDS_HOST_URL.openConnection(); MDS_CONN.setRequestProperty("Content-Type", "application/xml"); MDS_CONN.setRequestMethod("POST"); MDS_CONN.setAllowUserInteraction(false); MDS_CONN.setDoInput(true); MDS_CONN.setDoOutput(true); String Message = ""; Message += "<?xml version=\"1.0\"?>\r\n"; Message += "<!DOCTYPE pap PUBLIC \"-//WAPFORUM//DTD PAP 2.0//EN\"\r\n \"http://www.wapforum.org/DTD/pap_2.0.dtd\"\r\n [<?wap-pap-ver supported-versions=\"2.*,1.*\"?>]>\r\n"; Message += "<pap>\r\n"; Message += "<statusquery-message push-id=\"" + pushId + "\">\r\n"; Message += "<address address-value=\"WAPPUSH=" + PinID + "%3A100/TYPE=USER@rim.net\" />\r\n"; Message += "</statusquery-message>\r\n"; Message += "</pap>\r\n

 

New Developer
ssanthosh
Posts: 13
Registered: ‎01-08-2009
My Device: Not Specified

Re: PAP Status Query Issue

Only at RIM can they get away with this

New Contributor
nishi_nkm
Posts: 2
Registered: ‎10-13-2010
My Device: Not Specified

Re: PAP Status Query Issue

Can you please tell me exact MDS_HOST_URL.