axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Charnoky <>
Subject http keepalive for axis clients?
Date Tue, 31 May 2005 22:09:44 GMT
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) {}


View raw message