-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpTransPortSE - Timeout Not Respected #131
Comments
wanna send a PR to improve this? |
I would, but I am new on Github and not sure I am doing this right. The strange thing is when I compare my downloaded version, 3.6.4 in Android Studio, the Transport.java does not match the copy in ksoap2-android/ksoap2-base/src/main/java/org/ksoap2/transport/transport.java. I expected them to be the same, comparing latest to latest. Am I wrong? I also and completely unfamiliar with Maven. |
Sent a small PR which should fix this |
A workaround is: |
There are other programming errors around here as well. For example, ksoap2-android/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpsTransportSE.java Lines 30 to 31 in 0d2b179
ksoap2-android/ksoap2-j2se/src/main/java/org/ksoap2/transport/HttpTransportSE.java Lines 91 to 93 in 0d2b179
|
timeOut is passed to HttpTransportSE.
HttpTransportSE httpTransport = new HttpTransportSE(url, timeOut);
HttpTransportSE accepts the input into this constructor:
public HttpTransportSE(String url, int timeout) {
super(url, timeout);
}
super(url, timeout) - super is Transport.java. Looking into that, I find the constructor using only url, timeout.
It seems there is a relatively new implementation of "readtimeout" that is not getting set to the timeout passed. Every other constructor signature used will set this.readtimeout = the passed timeout. So it would seem that without this.readtimeout getting set, it will always use the default which is 20 seconds.
To get around this I just call
HttpTransportSE httpTransport = new HttpTransportSE(null, url, timeOut);
Passing "null" to the proxy parameter, which forces it to use the method which properly sets this.readtimeout to the passed value. Testing with this change, my web service calls were no longer timing out at 20 seconds, but at 60 like I asked it to.
The text was updated successfully, but these errors were encountered: