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

Web and WebWorks Development

Reply
New Contributor
Posts: 2
Registered: ‎08-11-2011
My Device: torch 9800
My Carrier: Rogers

Cannot reach server with XHR request

I am currently working with webworks on a blackberry torch application and am having trouble making an XHR call with devices that have a sim card in them.

 

When I test via wifi with no sim card or the simulator my xhr requests connect properly. The XHR request is connecting to an HTTPS endpoint.  

 

currently I have a very vanilla config.xml 

 <access subdomains="true" uri="https://www.example.com" /> (example.com is replaced with my own domain)

 

and I have

<rim:connection timeout="25">   
<id>TCP_WIFI</id>   
<id>MDS</id>   
<id>BIS-B</id>   
<id>TCP_CELLULAR</id>   
<id>WAP2</id>   
<id>WAP</id> 
</rim:connection>

 defined.

 

Any thoughts why my app can connect just fine without a sim card or via the simulator but not with the sim card installed?

 

Thanks,

 

Alan

Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: Cannot reach server with XHR request

Hi alanhietala,

 

Unless you have a great understanding of Java Transports do not change these at all. The default order is always the best as it will complete requests fastest but still use the Wifi radio first. Try removing the <rim:connection> entry and see if this is still the case.



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
New Contributor
Posts: 2
Registered: ‎08-11-2011
My Device: torch 9800
My Carrier: Rogers

Re: Cannot reach server with XHR request

Thanks for the quick reply. 

 

I tried removing the lines from the config.xml related to <rim:connection> but I am still encountering the same trouble. The strange thing is if I remove the sim card from the phone and rely exclusively on the wifi connection all of my requests go through properly.

 

Could there be something related to the SSL certificate I am using for the SSL encryption? Trying to think of reasons why the XHR request would work without a sim card installed but fail when the sim is in the phone (both 3g and wifi connections enabled).

 

This was the original reason I had the <rim:connection> lines in the config.xml to try to isolate which transport might be failing to connect.

 

Thanks for the speedy reply.

 

Alan Hietala

Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: Cannot reach server with XHR request

Hi alanhietala,

 

You could be right about it being the SSL certificate. Can you try a quick test for me? Does it work in the normal BB browser using the SIM card?



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)