09-25-2012 12:16 PM
Can you try posting your request to Eval instead of Production environment? I can help you debug better. Do you still have your app id and password for the Eval environment?
I took your .NET code and converted it to Java since I don't have a .NET environment and I was able to successfully issue the command:
StringBuffer data = newStringBuffer();
data.append("");
data.append("<?xml version=\"1.0\"?>");
// Data.AppendLine("<!DOCTYPE pap PUBLIC \"-//WAPFORUM//DTD PAP 2.1//EN\" \"http://www.openmobilealliance.org/tech/DTD/pap_2.1
data.append("<bpds version=\"1.0\" >");
// Data.AppendLine("<pap >");
data.append("<subscriptionquery-message pushservice-id=\"" + APP_ID + "\">");
data.append("<status status-value=\"active\"/>");
data.append("</subscriptionquery-message>");
// Data.AppendLine("</pap>");
data.append("</bpds>");
// Data.AppendLine("--" + Boundary);
data.append("");
ByteArrayOutputStream output =new ByteArrayOutputStream();
output.write(data.toString().getBytes());
HttpResponse httpResponse = client.transmitPOST(
"https://pushapi.eval.blackberry.com/mss/PD_cpSubQu
where the API for tranmistPOST is:
public HttpResponse transmitPOST(String url, ByteArrayOutputStream payload, String contentType, String username, String password, HttpHeaderList headers)
The HttpResponse gives me back the proper results.
09-25-2012 12:54 PM
09-25-2012 01:03 PM
09-25-2012 02:07 PM
09-25-2012 04:38 PM
Remove the <?xml ... part and I think you'll be good to go.
09-25-2012 04:42 PM
09-25-2012 04:52 PM
09-26-2012 08:44 AM
1) No there is no side effect to comment out the subscription call to the push initiator. But it is very strongly recommended you have subscription management in your push initiator. You should keep a fairly accurate persistent store of who is subscribed to your application and you should only be pushing to those devices. You should only use the subscriber query message periodically to reconcile your persistent store with the one in the RIM push service.
2) Yes you can.
<ppg url>/mss/PD_cpSub?cpAction=suspend&pin=
<ppg url>/mss/PD_cpSub?cpAction=resume&pin=
09-26-2012 10:33 AM
09-26-2012 03:12 PM
Martin, did a bit more digging and I found the real problem was that you had a blank line before the <?xml ... declaration tag. That tag needs to be first in your XML message. The Data.AppendLine(""); will add a newline at the top of the XML message that causes a problem. So re-add the XML declaration <?xml and comment out the newline:
//Data.AppendLine(""); <-- remove this
Data.AppendLine("<?xml version=\"1.0\"?>"); // <-- re-add this