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

share|improve this question

1 Answer 1

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

ws.Credentials = CredentialCache.DefaultCredentials;

or

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

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

http://support.microsoft.com/kb/896861

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

 
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.