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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


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
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.

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

Re: BrowserSession problem

Is it possible to make HTTPConnection with Just BIS?