SharePoint:Web 服务权限错误

发布于 2024-08-10 18:52:50 字数 664 浏览 4 评论 0原文

我有一个共享点网站,并且正在调用标准共享点 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

撩起发的微风 2024-08-17 18:52:50

您需要更改注册表中的一些设置才能使其正常工作。我知道这很烦人,但它确实有效:
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/

自找没趣 2024-08-17 18:52:50

这可能就是臭名昭著的DisableLoopBackCheck 问题。 此处获取解决方案和原因。

This is probably the infamous DisableLoopBackCheck problem. Get the solution and the reason here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文