I was getting below error, when I am trying to connect to SharePoint 2010 SiteData.asmx webservice. from VS 2010 asp.net website
the request failed with http status 401 unauthorized
Solution
System.Net.NetworkCredential myCredential = new System.Net.NetworkCredential();
myCredential.UserName = "";
myCredential.Password = "";
The above code has been changed as
myCredential = new NetworkCredential("username", "password", "domain");
Started working
I got below error, when I am trying to add SharePoint 2010 Site Data web service in to my Visual Studio 2010 website. "operation is not valid due to the current state of the object."
The above error is due to proxy authentication.
This can be solved by adding the below lines to web.config