SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am very new to SharePoint and Development in 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.

share|improve this question

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?

share|improve this answer
I did the following "ws.UseDefaultCredentrials = true;" and I already disabled the LoopBack. Any other ideas? Thank you – Brogers Apr 30 '12 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. – Steve Lineberry Apr 30 '12 at 19:11
Yes its on the same box. – Brogers Apr 30 '12 at 19:47
What happened when you set the credentials instead of using the default? – Steve Lineberry May 1 '12 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? – Steve Lineberry May 1 '12 at 15:17

Your Answer


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.