开发者

Unauthorised access when accessing WSS Lists.asmx web service using AD accounts

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 crede开发者_运维技巧ntials 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


Try:

Credentials = System.Net.CredentialCache.DefaultCredentials

Or

Credentials = System.Net.CredentialCache.DefaultNetworkCredentials


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜