You are here

Test Push service with MDS and BlackBerry Widgets

Blog Terms: 

 You will find the both push demo and the blackberry widgets demo soure here:

I have done everything following the tuturial step by step, but when i tried to send push data using the push demo, i always get the "400 Response error' from local MDS server.
Logs:  400 PushServlet: FAILED -#06 The specified delivery method is not possible

It took me almost one day to debug and try to find the iusse, but no result. Util i found this document:

Configure the BlackBerry MDS or MDS Simulator with ports used with the application-level reliability mode. To do so, open the file and add a push.application.reliable.ports parameter that lists the ports used for pushing data with the application-level reliability mode.

 The official push demo snippet codeto send push data:

           URL url = getPushURL(_pinField.getText());
            System.out.println(_resources.getString("HTTPPushDemo.status.sendingToString") + url.toString());

            //open the connection using the static member...
            HttpURLConnection conn =(HttpURLConnection)url.openConnection();
            conn.setDoInput(true);//For receiving the confirmation
            conn.setDoOutput(true);//For sending the data
            conn.setRequestMethod("POST");//Post the data to the proxy
            conn.setRequestProperty("X-RIM-PUSH-ID", pushId);
            conn.setRequestProperty("X-RIM-Push-NotifyURL", notifyURL);
            System.out.println("begin to post data");
            //Write the data
            OutputStream out = conn.getOutputStream();


You need change

 Then the push demo works fine, with 200 Http OK response. My MDS version is 4.0.






I like your blog,and also like the article,and thank you for provide me so much information :))

Thanks a lot for this post. It quite gets on ones nerves with delivered sample apps from vendors don't work. You post is a result of a week's research. Appreciate the post.

Good post.

This worked for me by commenting the line

// conn.setRequestProperty("X-RIM-Push-Reliability-Mode","APPLICATION");

Thanks and Regards

I was having this exact problem running the HTTPPushDemo. You've saved me that precious day of debugging you had to endure! So thank you so much for posting your solution.

There are a few users on the Blackberry Developer forum having this problem and the Blackberry rep didn't solve it for them, just re-iterated the tutorial steps as though they were wrong to report this error. Honestly, releasing buggy sample code is inexcusable. Shame on RIM. Thanks again!

When i am running run.bat for server side application, it running and immediately closing.

client side application is working on simulator.

This site is like a classroom, ecxept I don't hate it. lol

It should not to be closed, somewhere wrong

Good point. I hadn't thuohgt about it quite that way. :)