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

BlackBerry Push Development

Posts: 172
Registered: ‎05-01-2010
My Device: Z10
My Carrier: O2

Query Message Status



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">
    <statusquery-message push-id="'.$pushid.'">

    // 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_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_pushRequest with the same credentials as a push message is send. The PUSH-ID looks like: XXXXXXXXXX.XXXX and is from the response of a successful push. The response that I am getting is this:

Array ( [0] => Array ( [tag] => PAP [type] => open [level] => 1 ) [1] => Array ( [tag] => BADMESSAGE-RESPONSE [type] => complete [level] => 2 [attributes] => Array (
   [CODE] => 2000 [DESC] => 2000 [BAD-MESSAGE-FRAGMENT] => 2000 ) ) [2] => Array ( [tag] => PAP [type] => close [level] => 1 ) )


I am sure I am missing something, but cant find it really Smiley Sad



find my widgets -> http://blackberry.itbert.de
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Query Message Status

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?

Goodbye everybody!
Posts: 172
Registered: ‎05-01-2010
My Device: Z10
My Carrier: O2

Re: Query Message Status

Yep there was the problem in the xml send to the server. It had a couple blank spots Smiley Happy

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.

find my widgets -> http://blackberry.itbert.de