-
Notifications
You must be signed in to change notification settings - Fork 247
Description
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.
public Transport(String url, int timeout) {
this.timeout = 20000;
this.readTimeout = 20000;
this.xmlVersionTag = "";
this.bufferLength = 262144;
this.prefixes = new HashMap();
this.url = url;
this.timeout = timeout;
*** line missing here should be
this.readTimeout = 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.