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
Developer
Posts: 19
Registered: ‎07-21-2008
My Device: Not Specified

BrowserSession problem

Hello Experts,

I tried to load a page using API "BrowserSession" with following code

 

net.rim.blackberry.api.browser.BrowserSession browserSession = net.rim.blackberry.api.browser.Browser.getDefaultSession();

 browserSession.displayPage(https://mydomain.com)

 

It pops up an error message saying "200: Application can not accept the content [text/xml]"

 

I don't know how to fix this.

Please advice me on that.

 

Developer
Posts: 120
Registered: ‎07-16-2008
My Device: 9000

Re: BrowserSession problem


It sounds like a problem with the web page you are trying to load.  It is returning a content type of "text/xml" in the header and your BlackBerry doesn't seem to support that.  Can you load it by going to the url in your browser?  Which device are you running?  What browser is set as your default under Browser Options?
Kurt Zettel | Chief Architect | Metova
www.metova.com
Developer
Posts: 19
Registered: ‎07-21-2008
My Device: Not Specified

Re: BrowserSession problem

I am checking the above code in my 7290 simulator.

I am using JDE4.0.2.

Developer
Posts: 120
Registered: ‎07-16-2008
My Device: 9000

Re: BrowserSession problem

Can you load it by going to the url in your browser?
Kurt Zettel | Chief Architect | Metova
www.metova.com
Developer
Posts: 19
Registered: ‎07-21-2008
My Device: Not Specified

Re: BrowserSession problem

It pops up the same error. "200: Application can not accept the content [text/xml]"

 

Thanks. 

Developer
Posts: 120
Registered: ‎07-16-2008
My Device: 9000

Re: BrowserSession problem

It is not a problem with your code.  The browser does not support that content type.  If you are using html it may just be a matter of changing the content type.  If you are using xml and xsl it you may have to create a mobile version of the website that is used based on the user-agent or profile attributes.
Kurt Zettel | Chief Architect | Metova
www.metova.com
Highlighted
Developer
Posts: 19
Registered: ‎07-21-2008
My Device: Not Specified

Re: BrowserSession problem

I want to get just the XML response of the URL. 

Is there any way to get the response, without creating any special mobile version of the website?

I don't have TCP settings, WAPGateWayIP, BES.

 

I have only BIS provided by AirTel.

 

Please let me know the way to get the URL's response.

 

Thanks! 

 

Developer
Posts: 120
Registered: ‎07-16-2008
My Device: 9000

Re: BrowserSession problem

Perhaps you can change the content type to text/plain?  This may affect other applications but may allow it to display in the browser.  If you are trying to use the xml in your application you should look at the http connection examples instead of using the Browser API.
Kurt Zettel | Chief Architect | Metova
www.metova.com
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: BrowserSession problem

I'm guessing you really want to 'read' the page into your BlackBerry application and process it. 

 

I suggest you review the httpdemo supplied with the JDE, in fact I recommend that you get that working, and try it with the page you want to download.

 

Lots of applications do this sort of processing.

Developer
Posts: 19
Registered: ‎07-21-2008
My Device: Not Specified

Re: BrowserSession problem

Is it possible to make HTTPConnection with Just BIS?