axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Charnoky <>
Subject Re: http keepalive for axis clients?
Date Wed, 01 Jun 2005 22:21:26 GMT
I dug around in the code a bit to get my answer.  In case others need
help, here's the deal: org.apache.axis.soap.SOAPConnectionImpl creates a
new Call object every time is invoked.  Thus, it
is impossible to reuse a socket connection and make use of http/1.1

I got around this problem by chucking my SAAJ client code and using
Axis's JAX-RPC DII interfaces instead.  By creating my own Call object,
I found I could keep a socket open to the webserver I am polling.


Mike Charnoky wrote:
> Now that I fixed the SOAPAction bug in CommonsHTTPSender, I find that
> the TCP socket used by my client is not actually reused.  Every time I
> try to reuse a SOAPConnection to make a, a new TCP
> socket is established with the server.  Is this correct behavior?  Isn't
> the socket supposed to be reused (to take advantage of http keepalive)?
> I can see from tcpdump that the client is initiating the socket close,
> it always sends the FIN first.  Also, I see that the sockets are not
> closed immediately.  It looks like a bunch of sockets get closed at the
> same time every 13 sec or so.
> Again, I am using Axis 1.2 (final) with the Commons HTTPClient 3.0rc2.
> I am using these libraries to create a SOAP client using the SAAJ API.
> My client connects to a .net webservice.  It must query for data several
> times per minute, so I am trying to get HTTP/1.1 keepalive support working.
> The client code basically works like this:
> SOAPConnectionFactory factory = SOAPConnectionFactory.newInstance();
> SOAPConnection conn = factory.createConnection();
> while(true) {
>     SOAPMessage request = generateMyMessage();
>     SOAPMessage response =, url);
>     try { Thread.sleep(10000); } catch (Exception e) {}
> }
> noky

View raw message