1

I got stuck up with the following error, while trying to add reference for the web service Lists.asmx in sharepoint 2010 from VS.NET 2010.

The document at the url http://sp2010/_vti_bin/Lists.asmx was not recognized as a known document type. Metadata contains a reference that cannot be resolved: 'http://sp2010/_vti_bin/Lists.asmx'. The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'NTLM'. The remote server returned an error: (401) Unauthorized. If the service is defined in the current solution, try building the solution and adding the service reference again.

In our development environment SP2010 is hosted on Windows Server 2008 R2, the same machine is being used for development purpose.

I had tried the following steps to sort this out, but didn't get resolved.

  1. I was able to view the functions exposed by the webservice, after pasting the webservice URL "http://sp2010/_vti_bin/Lists.asmx" onto the browser on the same machine,

  2. I tried to pass the username\password details before referring the service but didn't find any option in VS.NET 2010.

Please help.

Update: *Solution:* Finally I created a new web application in sharepoint with anonymous authentication and created the site collection and root sites after that. Now the webservice is working perfectly fine, still don't what went wrong previously. Guys thanks for all your suggestions, from which I came to learn new troubleshooting tips.

5 Answers 5

3

Try giving the complete path to your site and appending the WSDL parameter:

http://sp2010/sites/mysitecollection/_vti_bin/Lists.asmx?WDSL
1

This could be the infamous loopback check. FGor more info check here.

1
  • As you said, I added the "DisableLoopbackCheck" entry in registry and restarted the machine, but still getting the same error.
    – AbrahamJP
    Commented Jun 8, 2011 at 13:22
1

Are you using the Add Service Reference dialog? If so, try clicking the Advanced button and then using Add Web Reference instead.

1
  • Yes I tried that too, but still the same problem. Anyhow thanks for your suggestion.
    – AbrahamJP
    Commented Jun 8, 2011 at 16:56
1

Solutions are described in on my SO answer.

To resume, two potential issues : http 401.1 or 402.1 error codes.

The former is due to the NTLM protocol, the later to the double hop disabled locally by default?.

2
  • I came to saw you solution while searching for the aforesaid problem, anyhow thank you very much for responding to my query.
    – AbrahamJP
    Commented Jun 23, 2011 at 16:46
  • happy to help, happy to be helped eventually :)
    – Steve B
    Commented Jun 23, 2011 at 18:53
0

I created a new web application in sharepoint with anonymous authentication and created the site collection and root sites after that. Now the webservice is working perfectly fine, still don't what went wrong previously. Guys thanks for all your suggestions, from which I came to learn new troubleshooting tips.

Your Answer

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

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