Skip to content

HttpTransPortSE - Timeout Not Respected #131

Description

@jpock76

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions