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: 3
Registered: ‎01-23-2009
My Device: Not Specified

HttpConnection gets redirected in the simulator but not on the device

When trying to debug a problem that was occurring only on my device but not in the simulator I discovered that the simulator or the MDS virtualization layer automatically handles HTTP redirects (the server status is 300 : HTTP_MOVED_TEMP or 301 : HTTP_MOVED_PERM).

In the simulator my HttpConnection object would always get a status of 200 HTTP_OK for URI's that had really been moved elsewhere.

On the device, however, it would get redirect status that my implementation was not set up to handle.

I thought I would post this in case anyone else encounters the same problem.

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

Re: HttpConnection gets redirected in the simulator but not on the device

Is your connection on the real BlackBerry handheld also going through the MDS Connection Service of a BlackBerry Enterprise Server?  If not, it would be up to your application to handle the redirection.  The link below lists the connection routes available on a BlackBerry handheld.

 

What Is - Different ways to make an HTTP or socket connection
Article Number: DB-00396

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

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: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: HttpConnection gets redirected in the simulator but not on the device

Does this happen with BIS? What if we make a request and the server returns a 302 and cookies and

other things in the headers? Are these absorbed by RIM servers?

 

Highlighted
Developer
Posts: 62
Registered: ‎05-29-2009
My Device: Not Specified

BIS-B handles redirects?

As asked above, does BIS-B behave like MDS with respect to redirects, authentication, session cookies, maximum request size?  I'm hoping to use BIS-B for my application (still working on ISV membership) to avoid the complication of APNs, but I need a transparent HTTP session.  At the moment during development I'm using direct TCP in the simulator.  It would be good to know now whether BIS-B will have the same issues as the MDS simulator

 

Thanks

 

Phil.