Mykhailo Hodovaniuk created AXIS2-5866:
------------------------------------------

             Summary: Axis ignores 
org.apache.axis2.client.Options#getTimeOutInMilliSeconds
                 Key: AXIS2-5866
                 URL: https://issues.apache.org/jira/browse/AXIS2-5866
             Project: Axis2
          Issue Type: Bug
          Components: client-api, transports
    Affects Versions: 1.7.4
         Environment: Java 8, Tomcat
            Reporter: Mykhailo Hodovaniuk
            Priority: Minor


According to documentation 
https://axis.apache.org/axis2/java/core/docs/http-transport.html the timeouts 
can be defined:
{code:java}
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);
...
{code}
But instead, Axis ignores this property because: 
org.apache.axis2.transport.http.CommonsHTTPTransportSender#invoke has code 
{code:java}
// 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);
            }
{code}
 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to