04-24-2012 02:51 PM
I am trying to get a status query for the Plus Service. Unfortunatly I am not getting the correct query build and getting a 2000 error message.
The query looks excact the same as to push a message, except the post fields.
$data = ' <?xml version="1.0"?> <!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.1//EN" "http://www.openmobilealliance.org/tech/DTD/pap_2.1
.dtd"> <pap> <statusquery-message push-id="'.$pushid.'"> </statusquery-message> </pap>'; // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, $pushurl); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_USERAGENT, "BB Push Server/1.0"); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, $appid . ':' . $password); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: multipart/related; boundary=mPsbVQo0a68eIL3OAxnm; type=application/xml", "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2", "Connection: keep-alive")); // grab URL and pass it to the browser $xmldata = curl_exec($ch);
The script is trying to query https://pushapi.eval.blackberry.com/mss/PD_pushReq
Array (  => Array ( [tag] => PAP [type] => open [level] => 1 )  => Array ( [tag] => BADMESSAGE-RESPONSE [type] => complete [level] => 2 [attributes] => Array ( [CODE] => 2000 [DESC] => 2000 [BAD-MESSAGE-FRAGMENT] => 2000 ) )  => Array ( [tag] => PAP [type] => close [level] => 1 ) )
I am sure I am missing something, but cant find it really
04-25-2012 11:36 AM
Are you replacing .$pushid. with a valid push ID? Does it get properly surrounded with double quotes? What is the full XML sent to the server?
04-25-2012 01:00 PM
Yep there was the problem in the xml send to the server. It had a couple blank spots
Now I am getting a "The request was refused. Status Query is not supported by your Push Service.". I will get in contact with the Push people to verify that, because the Service Type should be Plus.
Thanks for the hint and help.