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 SOAPConnection.call(), 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 = soapConnection.call(request, url);
try { Thread.sleep(10000); } catch (Exception e) {}
}
noky