I am very new to SharePoint and Development in ASP.net. And I am stuck on probably something very small. I created a VPC with WSS 3.0, SharePoint 2007, Windows Server 2008. (I followed TechNet's instructions)

The Issue:

I am creating a web service to pull information from a SharePoint list. I am using the WSS 3.0SDK's code for ReturnListItems and when I run the code I am getting this error.

System.Net.WebException: The request failed with HTTP status 401: Unauthorized.

I am not 100% sure where to go from here. I can only assume that the problem is an authentication issue.

1 Answer 1


First, did you set the webservice credentials to defaultcredentials or are you setting them manually.

ws.Credentials = CredentialCache.DefaultCredentials;


ws.Credentials = new NetworkCredential(userid, password, domain);

Second, if you are running everything on the same box, did you configure your backconnectionhostnames correctly?


  • I did the following "ws.UseDefaultCredentrials = true;" and I already disabled the LoopBack. Any other ideas? Thank you
    – Brogers
    Commented Apr 30, 2012 at 18:24
  • So everything is on the same box? If so you wouldn't have the NTLM double hop issue. Maybe try setting credentials to see if that changes anything. Commented Apr 30, 2012 at 19:11
  • Yes its on the same box.
    – Brogers
    Commented Apr 30, 2012 at 19:47
  • What happened when you set the credentials instead of using the default? Commented May 1, 2012 at 12:12
  • Maybe run fiddler and examine the results to see what is happening. Do you have anonymous turned on for the web application? Commented May 1, 2012 at 15:17

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.