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
Contributor
Posts: 41
Registered: ‎07-20-2011
My Device: BlackBeery 9800
My Carrier: Blackberry
Accepted Solution

Error :java.io.IOException Tunnel failied on webservice call usong Ksoap

Hi,

 

I am getting error while trying to call the webservice using ksoap in my application. The application is working well with my 9300 simulator (OS version: 6.0), but when I tried to run the same application on device I am getting the following error

Error :java.io.IOException Tunnel failied

 The first message that I got was

Error :java.io.IOException Invalid url parameter

Then I changed the code to

HttpTransport ht = new HttpTransport(soapUrl+";deviceSide=true;ConnectionType="+transportUsed);
ht.call(soapAction, envelope);

 Now I am getting error like these. I tried the code by using deviceside as true and false with no luck.

 

Anyone please help

Thanks & Regards,
Paabs
Developer
Posts: 19,633
Registered: ‎07-14-2008
My Device: Not Specified

Re: Error :java.io.IOException Tunnel failed on webservice call using Ksoap

Setting the correct connection suffix is you are doing it manually is not a trivial exercise.  You need to start by reviewing this:

 

http://supportforums.blackberry.com/t5/Java-Development/Different-ways-to-make-an-HTTP-or-socket-con...

 

I would also put network in the Search box on this forum and review the videos you will find.

 

This will give you a better understanding of what happens when you change the connection suffix and what tests you might like to do before you choose the suffix you want to use. 

 

The ultimate code in this regard is here:

http://supportforums.blackberry.com/t5/Java-Development/What-Is-Network-API-alternative-for-legacy-O...

Contributor
Posts: 41
Registered: ‎07-20-2011
My Device: BlackBeery 9800
My Carrier: Blackberry

Re: Error :java.io.IOException Tunnel failed on webservice call using Ksoap

[ Edited ]

Thanks peter.

 

I have gone through the links which you provided. I  did that before also, but my problem is with the HttpTransport call, not with the HttpConnection. In my application I had used HttpConnection for download operation and its working well in the device, but when it comes to the HttpTransport to call my webservice the device throws Error: jave.io.Exception Tunnel failed

 

I am able to connect to the specified webservice from my blackberry web browser. Also the HttpTransport is something looks likes below:

 

HttpTransport ht = new HttpTransport(soapUrl);
ht.call(SoapAction, envelope);

 Also I am able to create the HttpTransport object by specifying

ht= new HttpTransport(soapUrl+"deviceSide=true;interface="+transportType);

 

transportType is an integer value of available connection. In my application what I need to do is search for a network which is currently available and connect to the URL by using any of the available connections.

 

Please help me to make this application working

Thanks & Regards,
Paabs
Developer
Posts: 19,633
Registered: ‎07-14-2008
My Device: Not Specified

Re: Error :java.io.IOException Tunnel failed on webservice call using Ksoap

I might be wrong, but my understanding is that you can use the same connection strings in a kSoap call as you use in a normal httpConnection. So if you have got that part working, then you can use the same approach here I believe.

Contributor
Posts: 41
Registered: ‎07-20-2011
My Device: BlackBeery 9800
My Carrier: Blackberry

Re: Error :java.io.IOException Tunnel failed on webservice call using Ksoap

Hi,

 

I think my question confused you. In a normal HttpConnection, I am using 

 

HttpConnection httpCon=(HttpConnection) Connector.open(url);

 

In my application instead of this I am using the following code to find out the connection available and to connect via that.

 

ConnectionFactory confactory=new ConnectionFactory();
ConnectionDescriptor conDesc=confactory.getConnection(url);
if(conDesc!=null){
int transportUsed = conDesc.getTransportDescriptor().getTransportType();
hcon = (HttpConnection) conDesc.getConnection();

// do whatever you want

}

 

Is there anything similar to the above code which helps to establish the Http transport?

 

Thanks & Regards,
Paabs
Contributor
Posts: 41
Registered: ‎07-20-2011
My Device: BlackBeery 9800
My Carrier: Blackberry

Re: Error :java.io.IOException Tunnel failed on webservice call using Ksoap

[ Edited ]

Hi,

 

Anyone please help me on this issue. I searched a lot on the same issue and none of the methods works well. I am trying to get a solution for the last 1 week and I didn't get any. Its very urgent for me. I tried out a lot, but no luck.

 

My http connection is working well, the problem is only with the http transport (it is used for web service call). Please do post me with some right way to do this.

 

The application is working well on my simulator 9800(os 6.0) and I am facing this issue in the device 9300 (Os 6.0). I can run all other parts of my code in the device except the upload operation using web service call.

 

Thanks in advance

Thanks & Regards,
Paabs
New Developer
Posts: 120
Registered: ‎05-20-2011
My Device: Touch 9800
My Carrier: Vodafone

Re: Error :java.io.IOException Tunnel failed on webservice call using Ksoap

Hello Paabs,

 

Even i am conflicting with this issue....i have read so many articles about this but nothing seems to helped me.If u able to complete your task do share with us and one more thing have u used ksoap for complex types??

Amar
Contributor
Posts: 41
Registered: ‎07-20-2011
My Device: BlackBeery 9800
My Carrier: Blackberry

Re: Error :java.io.IOException Tunnel failed on webservice call using Ksoap

Yes I had used ksoap for making the web service call. Thats why I am making a http transport call instead of http connection.

Thanks & Regards,
Paabs
New Developer
Posts: 120
Registered: ‎05-20-2011
My Device: Touch 9800
My Carrier: Vodafone

Re: Error :java.io.IOException Tunnel failed on webservice call using Ksoap

I knw that but the thing is ksoap can be for simple parameters and for complex parameters and for complex paramaters we have to make complex classes implementing kvmserializable.My question is have u used these complex types in your project??

Thanks for your reply

Amar
Contributor
Posts: 41
Registered: ‎07-20-2011
My Device: BlackBeery 9800
My Carrier: Blackberry

Re: Error :java.io.IOException Tunnel failed on webservice call using Ksoap

Thanks for your quick reply.

 

Till this time I was not aware of complex and simple parameters of ksoap. But again I am using the methods in the following

 

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransport;
import org.ksoap2.transport.ServiceConnection;

 

I think I am using simple parameters. I am passing only string values to the web method.

Thanks & Regards,
Paabs