Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question

5 Answers 5

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

http://sp2010/sites/mysitecollection/_vti_bin/Lists.asmx?WDSL
share|improve this answer

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

share|improve this answer
    
As you said, I added the "DisableLoopbackCheck" entry in registry and restarted the machine, but still getting the same error. –  AbrahamJP Jun 8 '11 at 13:22

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

share|improve this answer
    
Yes I tried that too, but still the same problem. Anyhow thanks for your suggestion. –  AbrahamJP Jun 8 '11 at 16:56

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?.

share|improve this answer
    
I came to saw you solution while searching for the aforesaid problem, anyhow thank you very much for responding to my query. –  AbrahamJP Jun 23 '11 at 16:46
    
happy to help, happy to be helped eventually :) –  Steve B Jun 23 '11 at 18:53
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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