views:

253

answers:

2

I am having an issue where I try to access the Lists.asmx web service in a remote or local site and am getting a 401 error. To be clear, this is /_vti_bin/Lists.asmx. The setup is I have one WSS 3.0 site which connects via soap to the lists service of another, WSS/MOSS site. On our stage environment these two sites are on the same box, but in dev they're seperate. Whatever the situation, they're all on the same domain. Originally (prior to a rebuild) the web service calls worked fine in dev, but not in stage, which while puzzling at least confirmed that my implementation of the web service is correct, and the issue is one of authorisation. Here is my initial Lists service setup code:

new Lists
{
     Url = Utility.AppSetting("WSS.Url", true),
     Credentials = new NetworkCredential
     {
           UserName = Utility.AppSetting("WSS.UserName", true),
           Password = Utility.AppSetting("WSS.Password", true),
           Domain = Utility.AppSetting("WSS.Domain", true)
     }
};

With me manually specifying the domain credentials of the full access account on the server. However I suspect that the above code doesn't do anything and the service just authenticates using AD, i.e. my app pool account (which on dev is my super powered dev account). To lesson the burden on the release process, I would like to be able to explicitly set the credentials for the service, and not rely on the infrastructure official having to give his app pool account read/web service access to a remote wss instance.

Cheers

A: 

Try:

Credentials = System.Net.CredentialCache.DefaultCredentials

Or

Credentials = System.Net.CredentialCache.DefaultNetworkCredentials
Chris Stewart
Will not both those settings use the default AD account to authenticate? This I don't want to do, I want to log in explicitly.
Aquinas
A: 

For reference, issue was that the loopback check is very much an issue with Server2k8. Disabling it fixed the bug.

Aquinas