Here is my scenario : I am trying to access SharePoint 2010 list items via list.asmx service. Following is my code and app.config which works on my developer box hosting the SharePoint site
var client = new ServiceReferenceSPList.ListsSoapClient();
client.ClientCredentials.UserName.UserName = "...";
client.ClientCredentials.UserName.Password = "...";
var result = client.GetListItems("My List", null, query, viewFields, rowLimit, queryOptions, null);
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ListsSoap" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" >
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://server:port/_vti_bin/Lists.asmx"
binding="basicHttpBinding" bindingConfiguration="ListsSoap"
contract="ServiceReferenceSPList.ListsSoap" name="ListsSoap" />
</client>
</system.serviceModel>
Above code works when its run from SharePoint machine itself. I have SharePoint site on my machine and hence when I run above code it returns list items. However when I try to access SharePoint site hosted on other server on the network it throws error
The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'.
I have read few posts around this error but none seems to help.
- Call SharePoint custom WCF service from within same SharePoint site
- SharePoint search web service error (NTLM) when called from HttpHandler
- https://stackoverflow.com/questions/16273032/connect-to-sharepoint-web-service-through-claims-based-ntlm-authentication
I dont think I am facing double hop issue as I am passing credentials and code on development box directly going to SharePoint server. SharePoint 2010 site being accessed in a Claims enabled NTLM auth site.
Please let me know your suggestions to possibly solve this issue.