Q: How do I setup my Axis2 generated stub to reuse/share http connections across several calls?
A: It's not too complicated..
TestServiceStub myStub = new TestServiceStub(wsURL);In fact if you need more control over the Commons HTTPClient's MultiThreadedHttpConnectionManager [1], you can even set it up yourself and then use the above snippet to make sure it gets used.
myStub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.
http.HTTPConstants.REUSE_HTTP_CLIENT, new Boolean(true));
ConfigurationContext context = ConfigurationContextFactory.For any further details or questions axis-dev@ws.apache.org [2] (Prefix subject with with [Axis2])
createConfigurationContextFromFileSystem(null, null);
HttpClient httpClient = new HttpClient(new MultiThreadedHttpConnectionManager());
context.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);