04-02-2009 10:39 AM
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.co m%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>
Solved! Go to Solution.
04-15-2009 04:41 PM - edited 04-15-2009 04:41 PM
04-15-2009 04:45 PM
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
11-25-2009 12:35 PM
Only at RIM can they get away with this
10-13-2010 02:25 AM
Can you please tell me exact MDS_HOST_URL.