I am trying to consume SharePoint Server 2010 web services using a CXF
Client. The SP Server uses NTLM v2 for authentication. I have consulted the
cxf documentation on NTLM
http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport%28includingSSLsupport%29-NTLMAuthentication
here and am following it pretty close, however I am unable to get a
successful authentication. Here is my current code:
//Set the jcifs properties
jcifs.Config.setProperty("jcifs.smb.client.domain", "VANDERBILT");
jcifs.Config.setProperty("jcifs.netbios.wins",
"");
jcifs.Config.setProperty("jcifs.smb.client.soTimeout", "300000"); //5
minutes
jcifs.Config.setProperty("jcifs.netbios.cachePolicy", "1200"); //20
minutes
jcifs.Config.setProperty("jcifs.smb.client.username", username);
jcifs.Config.setProperty("jcifs.smb.client.password", password);
//Register the jcifs URL handler to enable NTLM
jcifs.Config.registerSmbURLHandler();
//String listsUrl =
"http://.../_vti_bin/Lists.asmx"
String listsUrl =
"https://int.../_vti_bin/Lists.asmx"
JaxWsProxyFactoryBean factoryBean = new
JaxWsProxyFactoryBean();
factoryBean.setServiceClass(com.microsoft.schemas.sharepoint.soap.ListsSoap.class)
factoryBean.setAddress(listsUrl)
//factoryBean.setUsername(username)
//factoryBean.setPassword(password)
port = (ListsSoap) factoryBean.create()
Client client = ClientProxy.getClient(port)
HTTPConduit http = client.getConduit()
HTTPClientPolicy httpClientPolicy = new
HTTPClientPolicy()
httpClientPolicy.setConnectionTimeout(36000)
httpClientPolicy.setAllowChunking(false)
httpClientPolicy.setReceiveTimeout(32000)
http.setClient(httpClientPolicy)
// AuthorizationPolicy policy = new
AuthorizationPolicy()
// policy.setUserName(username)
// policy.setPassword(password)
// http.setAuthorization(policy)
GetListItemsResponse.GetListItemsResult result
=
port.getListItems("AboutUs", null, null, null,
null, null, null)
The error I get back is
javax.xml.ws.WebServiceException: Could not send Message.
Caused by: java.io.IOException: IOException invoking
https://int.../Lists.asmx: Authentication failure
--
View this message in context:
http://cxf.547215.n5.nabble.com/CXF-Client-NTLM-Authentication-with-SharePoint-Server-tp5598272p5598272.html
Sent from the cxf-user mailing list archive at Nabble.com.