Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
jackofall
Posts: 120
Registered: 06-23-2009

can't access a website from my app on device

hi

i am using web server to authenticate my login details, my application is running fine in simulator but not accessing the website , when deployed on device,

I just want to know , is this possible that if your not not connected with you BES and just using the Wireless lan to access the web , then blackberry stops you access web sites from your application.

Because, i can open the same same web server site from my device but it is not opening when i access it from my application.

It doesn't sound logical but better to consult with experts.

 

Thanks & Regards

Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Please use plain text.
Developer
Posts: 1,474
Registered: 04-14-2009

Re: can't access a website from my app on device

What are the arguments you pass into Connector.open() in your app? I suspect you aren't appending ";interface=wifi" to the URL...

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: 07-15-2008

Re: can't access a website from my app on device

[ Edited ]

Which connection mechanism you are using to connect to the web from your application?

 

Is it throwing any exception? can you write back the exception?

 


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
Developer
peter_strange
Posts: 14,614
Registered: 07-14-2008

Re: can't access a website from my app on device

As suggested by klyubin, one option is to put ";interface=wifi" on your connection String and force the use of WiFi.

 

A word of caution, based on my understanding of how this works though. 

 

In a BES Environment, it will automatically use WiFi if it can, in other words, if it can find your BES via WiFi it will route the requests that way.  However to do this, it must first authenticate via wireless (non WiFi) and prove to its own satisfaction that it can get to your BES via WiFi.  If it has done this authentication, you can drop the wireless connection and it will continue to work via WiFi.  If you restart the device and only have WiFi, then the device will not authenticate and you can't get on with a BES/MDS connection.

 

However, if you have (previously) connected using BES/MDS, then your application is 'inside the firewall'.  I believe, but have not tested, that if you then connect via ";interface=wifi", you are now outside the firewall, and your application will have split-pipe problem.

Please use plain text.
Developer
jackofall
Posts: 120
Registered: 06-23-2009

Re: can't access a website from my app on device

[ Edited ]

Actually , this a  .NET web service and a BB application using KSoap.

I found another link on this forum but didn't get any solution yet.

I have seen that network video and other KB article as well.

Can anyone tell me , which approach in followed in KSOAP, Which i am using to connect with web.

1) BES/MDS

2) BIS-B

3) Direct TCP

4) WAP 2

5) WAP-1

 

So that i can change the setting of my device , by the way i am using 8320.

I think, it is BES/MDS because, it is working fine in simulator where we need to rum MDS simulator first , correct me if i am wrong?

Thanks & Regards

Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Please use plain text.
Developer
peter_strange
Posts: 14,614
Registered: 07-14-2008

Re: can't access a website from my app on device

kSoap using the same 'connection suffix' processing as an other http or socket connection uses when deciding how to route the transmission.  By default on the Simulator this is BES/MDS.  The default on a real device depends on how the device is configured.  This is not chosen by kSoap, it is chosen you when you set the connection suffix. If you have set nothing, it will use the default, the default will depend, as noted, on the type of device, how it is provisioned, and on the carrier.  So we can't tell you what will happen to your device. 

 

I suggest you review the following Thread, for more information:

http://supportforums.blackberry.com/t5/Java-Development/Connecting-your-BlackBerry-http-and-socket-c...

 

8320 does have the capability to run WiFi, so you could check WiFi is working and then add "interface=wifi" if it is.  But that will only work on WiFi enabled devices.

Please use plain text.
Developer
jackofall
Posts: 120
Registered: 06-23-2009

Re: can't access a website from my app on device

[ Edited ]

Thanks Pete_Strange,

 

I put this "interface=wifi" in HttpTransport but i have no idea where should i put this in my ksoap code.


        HttpTransport ht = new HttpTransport(serviceUrl+"interface=wifi");

 

other objects in ksoap code are;

 

  SoapObject rpc = new SoapObject(serviceNamespace, methodName);
              
 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

 

any idea, i didn't find any connector object in ksoap.

 

As you said :

"8320 does have the capability to run WiFi, so you could check WiFi is working and then add "interface=wifi" if it is.  But that will only work on WiFi enabled devices".

Wifi is working fine on my device and i can open the website which i am accessing from my application but my application is not able to get that.

 

Thanks & Regards

Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Please use plain text.
Developer
peter_strange
Posts: 14,614
Registered: 07-14-2008

Re: can't access a website from my app on device

kSoap is not my area, but where you have put this does seem correct.  However you have missed a very important semi-colon, the connection suffix is ";interface=wifi".  The semi-colon seems to be used by connection code on the device to separate the connection string and its parameters from the actual URL.

 

So give ";interface=wifi" a go.

Please use plain text.
Developer
jackofall
Posts: 120
Registered: 06-23-2009

Re: can't access a website from my app on device

After doing that ";interface=wifi" , i am not able to call the webservice and i am getting the following exception.

 

general error in syncData(): java.io.IOException: Tunnel failed

Thanks & Regards

Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Please use plain text.
Developer
peter_strange
Posts: 14,614
Registered: 07-14-2008

Re: can't access a website from my app on device

What device, OS Level and Carrier are you using?

Please use plain text.