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