You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Chris Averia <ch...@yahoo.com> on 2005/06/02 03:23:27 UTC
Closing HTTP1.1 Keep-Alive Session in CommonsHTTPSender
Hello,
I am developing my own webservice using the WSDL2Java server-side generated code. My webservice in turn, also acts as an Axis Client by making calls to other web services.
For this, I am using stubs also generated by WSDL2Java and specified CommonsHTTPSender as the transport inside client-config.wsdd. The purpose for me to use CommonsHTTPSender is to maintain an HTTP1.1 Keep-Alive connection so as to reduce the overhead in establishing TCP connections everytime I make an outgoing SOAP.
What I did was everytime my web service implementation class gets called to service the incoming SOAP, I create an instance of the stub and use it to make outgoing SOAP calls.
For example,
Stub stub = new Locator().getPort(url);
stub.method1();
stub.method2();
stub.method3();
stub.method4();
So if I use CommonsHTTPSender, the 4 method calls above maintains a single HTTP 1.1 Keep-alive connection (which is what my objective is).
However, I wanted to close the HTTP connection after the last method (method4). Becuase if i dont, I found out that the TCP connection to the server remains established. How do I do this?
Thanks!
Chris
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com