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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
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
Posts: 15,885
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

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.
Developer
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
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
Posts: 2
Registered: ‎10-13-2010
My Device: Not Specified

Re: PAP Status Query Issue

Can you please tell me exact MDS_HOST_URL.