1

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.

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.

1 Answer 1

0

You have to log in to target site manually, with that service account. Seems like the client just can not login to the site at the first time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.