Welcome!

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

Java Development

Reply
New Developer
Posts: 11
Registered: ‎11-19-2009
My Device: Not Specified

HTTPPush Demo Not working

Hello,

 

I want to use HttpPush in my application. To get an idea about how to use the push feature, I tried to run the HttpPushDemo on the simulator, much the same way as explained in the README.txt. However, when I started the MDS Server Simulator and then started theServer Side and Client Side application in the simulator, I got the following behaviour:

 

1. Attempt to access any site like- www.google.com succeeds from the Browser in Device Simulator. Thus confirming the connectivity with the MDS simulator.

2. Attempt to send using the "rim" option fails with the error message "java.io.IOException: Server returned HTTP response code: 400 for URL: http://localhost:8080/push?DESTINATION=2100000A&PORT=7874&REQUESTURI=localhost"

3. Attempt to send using the "pap" option succeeds but the following behavior is noted:

There is some activity in the MDS window indicating that the data is sent (so is reported by the HTTP Push Demo server side application) and there is a message in the MDS window, saying-

<2009-03-21 20:30:15.110 IST>:[529]:<MDS-CS_MDS>:<DEBUG>:<LAYER = SCM, EVENT = PushServlet: POST request from [UNKNOWN @ 127.0.0.1] to [PAPDEST=WAPPUSH%3D210000A%253A100%2FTYPE%3DUSER%40rim.net&PORT=100&REQUESTURI=/] : -1 bytes...>

<2009-03-21 20:30:15.110 IST>:[532]:<MDS-CS_MDS>:<DEBUG>:<LAYER = SCM, EVENT = PAP push-id pushID:-976581757 returned status code 3007>

 

In the applicatio running inside the Device Simulator, nothing is received  :-(

 

The server side Push demo application, after some time displays the message- "Notification connection timeout. Restarting..."

 

Can any one help me understanding this behavior ?   I am new to this MDS stuff.

 

Thanks in advance,

 

Regards,

 

kiruba

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: HTTPPush Demo Not working

Just a stab in the dark, but the MDS_CS applicaiton does not allow a connection to localhost - it mimics the contraints of a BES environment.

 

You should alias this in your hosts file to a different (dummy) domain, like "foobar.com"

 

 

Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: HTTPPush Demo Not working

try using the local ip instead

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Developer
Posts: 11
Registered: ‎11-19-2009
My Device: Not Specified

Re: HTTPPush Demo Not working

i given ip adress but still it is not working same error produced...

 

In client HTTPPush Demo

 

private static final String DEVICE_PIN = "2100000A";

 

private static final String DEVICE_PORT = "7874";

 

private static final int MDS_PORT = 8080;

 

private static final String URL = http://:100;

 

And also In server HTTPPush Demo

 

 

String notifyURL="http://localhost:7778";

 

ServerSocket serverSocket = new ServerSocket(7778);

 

Is it correct ?

 

 

 

Private

BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: HTTPPush Demo Not working

You can send a push to the MDS SImulator using localhost.  You are not able to connect to localhost through the MDS Simulator from an application running within the BlackBerry smartphone simulator.

 

The output you have above appears to be from 2 different samples.  The first is from the browserpushdemo (using port 7874) and the second using the httppushdemo (using port 100).

 

Can you post the ouput you see in the MDS-Simulator for the first error?

 

For the second error, please make sure you followed all of the configuration steps in the readme.txt for the httppushdemo.  It appears that you missed the step to configure port 100 in the rimpublic.property file for the MDS Simulator.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 11
Registered: ‎11-19-2009
My Device: Not Specified

Re: HTTPPush Demo Not working

Source

 

Server :

private static final String DEVICE_PIN = "2100000A";

private static final String DEVICE_PORT = "7874";

private static final int MDS_PORT = 8080;

private String notifyURL=http://www.vojus.com

ServerSocket serverSocket =new ServerSocket(7778);

 

Client

 

private static final String URL = http://:7874;

push.application.reliable.ports=7874

 

 

 

Rim Push this error occur in MDS Simulator

 

<2009-11-30 16:42:45.406 GMT+05:30>:[337]:<MDS-CS_MDS>:<DEBUG>:<LAYER = SCM, EVENT = Notifying to URL = http://www.vojus.com, pushId = pushID:-2018018890, destination = 2100000A, result code = 400 net.rim.protocol.iplayer.push.b: Push connection aborted by device>

 

PAP Push this error occur in MDS Simulator

 

<2009-11-30 16:55:15.169 GMT+05:30>:[390]:<MDS-CS_MDS>:<DEBUG>:<LAYER = SCM, EVENT = Notifying to URL = http://www.vojus.com, pushId = pushID:1586099339, destination = 2100000A, result code = 5238 net.rim.protocol.iplayer.push.b: Push connection aborted by device>

 

Cld u please fix this error?

BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: HTTPPush Demo Not working

The notifyURL is the URL the BlackBerry Enterprise Server (or in this case the MDS-CS Simulator) will use to contact the pushing application to inform it if the push was successfully delivered or if the delivery failed.  This should point back to the application and not be modified if you are trying to run the application as is.

 

Are you able to use the BlackBerry Browser in the BlackBerry smartphone simulator?  Is the httppushdemo running in the BlackBerry smartphone simulator?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 173
Registered: ‎06-11-2009
My Device: Not Specified

Re: HTTPPush Demo Not working

[ Edited ]

MSohm wrote:

Are you able to use the BlackBerry Browser in the BlackBerry smartphone simulator?  Is the httppushdemo running in the BlackBerry smartphone simulator?


OK, to be absolutely clear.

I run into the same problem just following README.txt file without any modification in source or settings/configurations.

Except for that port 100 stuff mentioned in readme.txt of course.

Looks like sample of HTTP Push does not work 'out of box', BTW, I've got the same messages mentioned above.

Smiley Sad

P.S. Following README.txt I was able to use BB Browser. In fact, other related samples work OK.

Same (OK) for the applications which deal with  different types of Connector.open(...) and different listeners.

P.S.S. Sorry about messages. I've got one more:

-----------

 <2009-12-05 15:19:13.531 EST>:[102]:<MDS-CS_MDS>:<DEBUG>:<LAYER = SCM, EVENT = PushServlet: FAILED - The specified delivery method is not possible>

-----------

BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: HTTPPush Demo Not working

Please refer to the following:

 

Support - The specified delivery method is not possible
Article Number: DB-00522

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800662/Support...

 

 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 10
Registered: ‎07-16-2009
My Device: Not Specified

Re: HTTPPush Demo Not working

I used to encounter a similar problem while trying to run the HTTPPushDemo on my device simulator. However, on one occasion, I tried to run the HTTPPushDemo, and it encountered problems similar to the one mentioned above. After this attempt, I opened a website in the Browser of the simulator (any website) and tried to run the HTTPPushDemo again, and it worked. I have no clue as to why this happened.