goodev / ksoap2-android

Automatically exported from code.google.com/p/ksoap2-android
1 stars 0 forks source link

HttpTransportSE timeout is Not play a role #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.I will set timeout, But to no avail.

This is the code of HttpTransportSE.java

protected ServiceConnection getServiceConnection()
        throws IOException
    {
        return new ServiceConnectionSE(proxy, url);
    }

I think is:

protected ServiceConnection getServiceConnection()
        throws IOException
    {
        return new ServiceConnectionSE(url, timeout);
    }

Original issue reported on code.google.com by mxl860...@gmail.com on 5 May 2011 at 3:10

GoogleCodeExporter commented 9 years ago
What version of the product are you using? On what operating system?
2.54, Windows 7

Original comment by mxl860...@gmail.com on 5 May 2011 at 3:19

GoogleCodeExporter commented 9 years ago
Not sure what your question is..

Original comment by mosa...@gmail.com on 1 Jun 2011 at 6:21

GoogleCodeExporter commented 9 years ago

Original comment by mosa...@gmail.com on 6 Jun 2011 at 10:44

GoogleCodeExporter commented 9 years ago
I have the same problem with httptransporteSe

Original comment by miguelca...@gmail.com on 14 Jun 2011 at 2:16

GoogleCodeExporter commented 9 years ago
There is another issue open that relates to this one (issue 60).

I'm having the same problem running 
ksoap2-android-assembly-2.5.6-jar-with-dependencies. I would have assumed the 
ksoap timeout value that appears on HttpTransportSE would be equivalent to what 
you can accomplish using org.apache.http.client.HttpClient with connection 
timeout and socket timeout pamameters:

HttpClient client = new DefaultHttpClient(); HttpParams params = 
client.getParams(); HttpConnectionParams.setConnectionTimeout(params, 
CONNECTION_TIMEOUT); HttpConnectionParams.setSoTimeout(params, SOCKET_TIMEOUT);

I finally get a SocketException "the operation timed out" after ~3 minutes no 
matter what value I put in the timout parameter on HttpTransportSE. My server 
is running, its just not responding to the request.

http://stackoverflow.com/questions/5489671/ksoap-never-timeout/6549720#6549720

Original comment by jam.mon...@gmail.com on 1 Jul 2011 at 3:26

GoogleCodeExporter commented 9 years ago
The time was seemingly never set properly depending on how you create the 
transport. I have committed a potential fix to the github repo. Could you try 
it out? 

Original comment by mosa...@gmail.com on 5 Jul 2011 at 6:05

GoogleCodeExporter commented 9 years ago

Original comment by mosa...@gmail.com on 5 Jul 2011 at 2:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thank you so much Manfred Moser.
I built the ksoap2-android-assembly-2.5.7-SNAPSHOT-jar-with-dependencies.jar
Finally the timeout works nice.
Issue 52 solved for me.

Test setup:
* 3G network aviable and WS down.
* Windows 7
* Android 2.2
* SDK AVD 11

Original comment by celiovasconcelos@gmail.com on 6 Jul 2011 at 2:06

GoogleCodeExporter commented 9 years ago
Great. It sort of also solved issue 60 right? I will cut a new release today.. 

Original comment by mosa...@gmail.com on 6 Jul 2011 at 3:31

GoogleCodeExporter commented 9 years ago
Fix is in 2.5.7

Original comment by mosa...@gmail.com on 6 Jul 2011 at 11:11

GoogleCodeExporter commented 9 years ago
2.5.7 Still doesn't time out at all on Samsung Charge with Android 2.2.1. My 
app locks up indefinitely when an internet connection drops during a web 
service call. To simulate that problem, disable the cellular data and connect 
the device to the Internet through a WiFi router. Execute the web service call 
and while it is waiting for data to return, remove the Internet cable from the 
router. The same code times out correctly on Samsung Galaxy X with 2.2.1, 
Samsung Galaxy Tablet with 2.2.1, Motorola Flipout with 2.1, Motorola Bravo 
with 2.1 and HTC android incredible with Android 2.2

Original comment by aymanmia...@gmail.com on 3 Aug 2011 at 8:27

GoogleCodeExporter commented 9 years ago
Thats interesting and I have no way of debugging or so. Also keep in mind that 
there is NO android specific code in ksoap android and therefore the bug must 
be in the underlying platform. So basically there is nothing I can do for you. 
You will have to debug your Android code. But if you find something that goes 
wrong in the ksoap codebase I am more than happy to take a pull request in.. 

Original comment by mosa...@gmail.com on 3 Aug 2011 at 8:34

GoogleCodeExporter commented 9 years ago
Thanks. By the way, in 2.5.2 with timeout Jar file, there was a setTimeout 
method. It was working great until my app ran on the Samsung Charge and when 
this method is called, the app would crash. It didn't crash if the time out is 
set in the class constructor 
HttpTransportSE htransport = new HttpTransportSE(URL, WebServices.TIMEOUT);
would you have any idea what would make setTimeout in 2.5.2 crashes?
I would be more than happy to send you my Samsung Charge if you would like to 
debug the problem on it? May be the platform on the charge is not as tolerant 
as other platforms or the platform itself has a bug.

Original comment by aymanmia...@gmail.com on 3 Aug 2011 at 10:51

GoogleCodeExporter commented 9 years ago
The crash might be inconsistent state when setTimeout is called.I wont have 
time to debug for you though. Just debug into the library and see. Maybe send 
the stacktrace. In any case though use the latest version.

Original comment by mosa...@gmail.com on 5 Aug 2011 at 5:09

GoogleCodeExporter commented 9 years ago
On version 2.5.5 timeout did not work.

Switched to 2.5.7 (latest build) and works flawlessly. I am testing it on 
Android 2.2.1 Samsung Ace.

Original comment by santiban...@gmail.com on 5 Aug 2011 at 8:32

GoogleCodeExporter commented 9 years ago
I did some fixes related to the timeout stuff in the last two releases...

Original comment by mosa...@gmail.com on 5 Aug 2011 at 8:39