SharePoint:Web 服务权限错误
我有一个共享点网站,并且正在调用标准共享点 Web 服务。
我像这样创建 Web 服务请求:
wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx";
当我使用 localhost 作为主机名时,它可以工作,但是当我使用计算机名称时,我收到错误 401 Unauthorized。
我设置的凭据是这样的:
NetworkCredential NC;
if (string.IsNullOrEmpty(this.Domain))
{
NC = new NetworkCredential(this.Username, this.Password);
}
else
{
NC = new NetworkCredential(this.Username, this.Password, this.Domain);
}
//Lists
wsLists.Timeout = -1;
wsLists.Credentials = NC;
//Dws
wsDws.Timeout = -1;
wsDws.Credentials = NC;
有什么想法可以解决这个问题吗?
I have a sharepoint site, and I am calling a standard sharepoint web service.
I create the web service request like this :
wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx";
When I use localhost as hostname it works, but when I use machine name I get an error 401 Unauthorized.
I am setting the credentials like this:
NetworkCredential NC;
if (string.IsNullOrEmpty(this.Domain))
{
NC = new NetworkCredential(this.Username, this.Password);
}
else
{
NC = new NetworkCredential(this.Username, this.Password, this.Domain);
}
//Lists
wsLists.Timeout = -1;
wsLists.Credentials = NC;
//Dws
wsDws.Timeout = -1;
wsDws.Credentials = NC;
Any ideas how I can fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要更改注册表中的一些设置才能使其正常工作。我知道这很烦人,但它确实有效:
http://koenvosters.wordpress.com/2009/06/15/access-denied-when-using-hostname-search-and-site-on-moss-2007/
You need to change some settings in your registry to make it work. Quite annoying I know, but it does the trick:
http://koenvosters.wordpress.com/2009/06/15/access-denied-when-using-hostname-search-and-site-on-moss-2007/
这可能就是臭名昭著的DisableLoopBackCheck 问题。 此处获取解决方案和原因。
This is probably the infamous DisableLoopBackCheck problem. Get the solution and the reason here.