我在 Sharepoint 2007 机器上托管了一个 ASP.NET Web 应用程序,它对 Sharepoint 进行 Web 服务调用以检索文档位置(特别是 GetListItems 方法)。
使用具有适当权限的有效 Sharepoint 帐户的传递凭据使用该服务。
ListServiceWrapper listService = new ListServiceWrapper();
/*Pass credentials to service call object*/
listService.Credentials = new NetworkCredential(spUserName, spPassword, spDomain);
/*Set the Url property of the service for the path to a subsite.*/
listService.Url = ConfigurationManager.AppSettings.Get("rootSite") + "/_vti_bin/lists.asmx";
当 Web 应用程序在我的开发盒上本地运行时(我是同一域上的 Sharepoint 用户),服务调用效果很好。当部署到 Sharepoint 框时,应用程序返回:
请求失败,HTTP 状态为 401:未授权。
我们尝试将 Sharepoint 框上 Web 应用程序的 App Pool 用户更改为授权的 Sharepoint 用户,但仍然没有任何运气。我想如果我们将 Sharepoint 身份验证更改为 Kerberos 而不是 NTLM,它将解决问题。不幸的是,这不是一个选择。这可能与 NLTM 双跳问题有关吗?