cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Madhav Vodnala" <mvodn...@tibco.com>
Subject RE: CXF - NTLM - HttpConduit.close does not close the connection
Date Wed, 18 May 2011 20:13:00 GMT
Thanks Dan but that did not work. It appears to close the connection
after every
request.

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Wednesday, May 18, 2011 11:49 AM
To: users@cxf.apache.org
Cc: Madhav Vodnala
Subject: Re: CXF - NTLM - HttpConduit.close does not close the
connection


Instead of doing:

 System.setProperty("http.keepAlive", false) 

can you try:

httpClientPolicy.setConnection(ConnectionType.CLOSE);

That sets the header for the interaction from CXF which MAY occur after
the 
one used for the NTLM handshake.   I'm not really sure though.

Dan




On Wednesday, May 18, 2011 2:05:03 PM Madhav Vodnala wrote:
> We create a sharepoint webservice using the following code.
> 
> 
> 
> To provide NTLM credentials:
> 
> 
> 
> Authenticator.setDefault( extended class of Authenticator);
> 
> 
> 
> Create the service.
> 
> 
> 
> JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> 
> factory.setServiceClass(ListsSoap.class);
> 
> factory.setAddress(list_url);
> 
> ListsSoap port = (ListsSoap) factory.create();
> 
> 
> 
> Update the conduit.
> 
> ..
> 
>             Client client = ClientProxy.getClient(port);
> 
> 
> 
>             HTTPConduit http = (HTTPConduit) client.getConduit();
> 
> 
> 
>             HTTPClientPolicy httpClientPolicy = new 
> HTTPClientPolicy();
> 
>             httpClientPolicy.setConnectionTimeout(36000);
> 
>             httpClientPolicy.setAllowChunking(false);
> 
>             http.setClient(httpClientPolicy);
> 
> 
> 
> Call service and get the result.
> 
> 
> 
> GetListCollectionResult result  = port.getListCollection();
> 
> 
> 
> ..
> 
> And finally close the conduit.
> 
> 
> 
> http.close();
> 
> 
> 
> The problem is, we still see a HTTPURL connection held by the 
> KeepAlive thread.
> 
> We tried
> 
> System.setProperty("http.keepAlive", false) but that creates an issue 
> with NTLM authentication as it requires the connection to be persisted

> during the handshake request/response exchange.
> 
> 
> 
> How do we close the connection in this (with NTLM  authentication)
case?
> Has anybody used CXF inside tomcat
> 
> server serving SharePoint services connecting to a SharePoint server 
> over NTLM authentication.
> 
> 
> 
> This application runs inside Tomcat so it is instantiated from 
> multiple threads. If the connections are reused then there is a 
> potential of one user's authenticated connection used for another 
> user.
> 
> 
> 
> Thanks in advance.

--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Mime
View raw message