Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
//Set up Credentials
final org.apache.commons.httpclient.NTCredentials nt = new org.apache.commons.httpclient.NTCredentials("myUsername", "myPassword", "myMachineName", "myDomain");
final org.apache.commons.httpclient.auth.CredentialsProvider myProvider = new org.apache.commons.httpclient.auth.CredentialsProvider()
{
public org.apache.commons.httpclient.Credentials getCredentials(final org.apache.commons.httpclient.auth.AuthScheme scheme, final String host, int port, boolean proxy) throws org.apache.commons.httpclient.auth.CredentialsNotAvailableException
{
return nt;
}
};
//apply credentials
org.apache.commons.httpclient.params.DefaultHttpParams.getDefaultParams().setParameter("http.authentication.credential-provider", myProvider);
routines.ListsSoap_PortType ListSvc = new routines.ListsLocator().getListsSoap();
routines.ListsSoap_BindingStub stub = (routines.ListsSoap_BindingStub)ListSvc;
//disable chunking
java.util.Map<String, Object> httpSettings = new java.util.Hashtable();
httpSettings.put(org.apache.axis.transport.http.HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED, false);
stub._setProperty(org.apache.axis.transport.http.HTTPConstants.REQUEST_HEADERS, httpSettings);
// finally call service
routines.GetListResponseGetListResult result = ListSvc.getList("Things I Like");
POST /_vti_bin/Lists.asmx HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.4952)
VsDebuggerCausalityData: uIDPoxyyoXuy6fNCtaqQ1pwHJngAAAAA+QrjHqV8ckOfRxZmSv0moi81cbu45+hKjs5WNvHEqs4ACQAA
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://schemas.microsoft.com/sharepoint/soap/GetList"
Host: 127.0.0.1:8888
Content-Length: 353
Expect: 100-continue
Connection: Keep-Alive
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetList xmlns="http://schemas.microsoft.com/sharepoint/soap/"><listName>Things I Like</listName></GetList></soap:Body></soap:Envelope>
POST /_vti_bin/Lists.asmx HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.4952)
VsDebuggerCausalityData: uIDPoxyyoXuy6fNCtaqQ1pw (snip)
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://schemas.microsoft.com/sharepoint/soap/GetList"
Authorization: NTLM TlRMTVNTUAABAAAAt4II4gAAAAAAAAAAAAAAAAAAAAAGAbAdAAAADw==
Host: 127.0.0.1:8888
Content-Length: 0
POST /_vti_bin/Lists.asmx HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.4952)
VsDebuggerCausalityData: uIDPoxyyoXuy6fNCtaqQ1pwHJngAAA (snip)
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://schemas.microsoft.com/sharepoint/soap/GetList"
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAIoAAAAYAB (snip)
Host: cos-it05d:8888
Content-Length: 353
Expect: 100-continue
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetList xmlns="http://schemas.microsoft.com/sharepoint/soap/"><listName>Things I Like</listName></GetList></soap:Body></soap:Envelope>
HTTP/1.1 401 Unauthorized
Server: Microsoft-IIS/7.5
SPRequestGuid: 6398842b-8b9b-45d6-9c5e-fe247ffd8f8d
WWW-Authenticate: NTLM
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 14.0.0.4762
Date: Fri, 04 Mar 2011 23:43:36 GMT
Content-Length: 0
HTTP/1.1 401 Unauthorized
Server: Microsoft-IIS/7.5
SPRequestGuid: 1efc66a9-7b46-4519-a5b8-e4bdb536cc81
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAEAAQADgAAAA1 (snip)
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 14.0.0.4762
Date: Fri, 04 Mar 2011 23:43:36 GMT
Content-Length: 0
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
SPRequestGuid: 2597627a-6aee-489a-b8af-e6c9eaeb3ea9
Set-Cookie: WSS_KeepSessionAuthenticated={61216cd2-250a-44e4-9b96-480f55ccb5cd}; path=/
X-SharePointHealthScore: 5
X-AspNet-Version: 2.0.50727
Persistent-Auth: true
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 14.0.0.4762
Date: Fri, 04 Mar 2011 23:43:36 GMT
Content-Length: 41019
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetListResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/"><GetListResult> (snip) </GetListResult></GetListResponse></soap:Body></soap:Envelope>