Question

My Axis2 service client ConnectionTimeout is lasting too long [about 60 seconds] when validation team stresses the application by disconnecting the webservices server, even when using next code:

serviceClient.getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, 1000);
serviceClient.getOptions().setProperty(HTTPConstants.SO_TIMEOUT, 5000);

My Axis2 components versions are:

axis2: 1.5
axis2-transport-http: 1.5.4
axis2-transport-local: 1.5.4
wsdl4j [if useful]: 1.6.2

Is it no longer used?

Thanks in advance, kind regards.

Was it helpful?

Solution

Finally I figured out that was wrong regarding this issue was the place where I placed the CACHED_HTTP_CLIENT parameter:

Incorrect code:

serviceClient.getOptions().setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);

Correct code:

ConfigurationContext axisContext;
try {
    axisContext = ConfigurationContextFactory.createDefaultConfigurationContext();
} catch (Exception e) {
    throw new AxisFault(e.getMessage());
}
axisContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
stub = new MyStub(axisContext, url);

Axis2 1.5.1 connections management

OTHER TIPS

Finally, this issue was solved by downgrading Axis2 version. My last pom is pointing at next component versions:

axis2: 1.4.1
axis2-adb: 1.4.1
axis2-transport-http: 1.5
axis2-transport-local: 1.5
wsdl4j: 1.4

I hope this monologue helps somebody. Kind regards.

P. S. I'll keep track of Axis2 1.7 in case I can help them with this simple issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top