Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5866

Axis ignores org.apache.axis2.client.Options#getTimeOutInMilliSeconds

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Incomplete
    • Affects Version/s: 1.7.4
    • Fix Version/s: None
    • Component/s: client-api, transports
    • Labels:
      None
    • Environment:
      Java 8, Tomcat

      Description

      According to documentation https://axis.apache.org/axis2/java/core/docs/http-transport.html the timeouts can be defined:

      For runtime configuration, it can be set as follows within the client stub:
      ...
      Options options = new Options();
      options.setProperty(HTTPConstants.SO_TIMEOUT, new Integer(timeOutInMilliSeconds));
      options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, new Integer(timeOutInMilliSeconds));
      
      // or
      options.setTimeOutInMilliSeconds(timeOutInMilliSeconds);
      ...
      

      But instead, Axis ignores this property because: org.apache.axis2.transport.http.CommonsHTTPTransportSender#invoke has code

      // set the property values only if they are not set by the user explicitly
                  if (msgContext.getProperty(HTTPConstants.SO_TIMEOUT) == null) {
                      msgContext.setProperty(HTTPConstants.SO_TIMEOUT, soTimeout);
                  }
      
                  if (msgContext.getProperty(HTTPConstants.CONNECTION_TIMEOUT) == null) {
                      msgContext.setProperty(HTTPConstants.CONNECTION_TIMEOUT, connectionTimeout);
                  }
      

      where connectionTimeout and soTimeout are always non null.
      At the same time org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl#setTimeouts tries to define these values if they are null with timeOutInMilliSeconds.

      The problem is that org.apache.axis2.transport.http.CommonsHTTPTransportSender#invoke is higher in call hirarchy so the org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl#setTimeouts does not work as expected. The SO_TIMEOUT and CONNECTION_TIMEOUT parameters are always defined inside org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl#setTimeouts.

      The workaround is to define timeouts in axis2.xml.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mhodovaniuk Mykhailo Hodovaniuk
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: