简体   繁体   English

Asp.NET委派和调用SharePoint Web服务

[英]Asp.NET Delegation and Calling a SharePoint Webservice

I'm trying to make a call to the SharePoint Search Webservice from an Asp.NET 4.0 application that does not reside on the SharePoint server. 我正在尝试从不在SharePoint服务器上的Asp.NET 4.0应用程序调用SharePoint搜索Web服务。 Everything seems to work, accept it is using the AppPool's credentials (a domain service account) to authenticate to SharePoint, which only returns results that that pin has access to. 一切似乎都正常,接受它正在使用AppPool的凭据(域服务帐户)对SharePoint进行身份验证,SharePoint仅返回该图钉可以访问的结果。 What I need to be able to do is impersonate the calling user, so that I get results for that user and not the domain account. 我需要做的是模拟主叫用户,以便获得该用户而不是域帐户的结果。 I've set the server that the application is running under up to be trusted for delegation to the http spn that the SharePoint server is using, but I get a 401 error when doing the impersonation in my code. 我已将应用程序正在运行的服务器设置为受信任的服务器,以委派给SharePoint服务器正在使用的http spn,但在代码中进行模拟时却收到401错误。 What could I be doing wrong? 我可能做错了什么?

you have to impersonate your call to the sharepoint web service. 您必须模拟对sharepoint Web服务的呼叫。

you can do this at a web application level, with either the calling user or a static user, inside the web.config in the system.web node using the identity element, ie.. 您可以在Web应用程序级别上,通过使用identity元素,在system.web节点中的web.config中,与调用用户或静态用户一起执行此操作。

<system.web>
    <identity impersonate="true" />
</system.web>

or you can do this with inline code when you make your requesting call. 或者您可以在发出请求的呼叫时使用内联代码来执行此操作。

here is a microsoft KB on how to impersonate with an asp.net application. 这是有关如何模拟asp.net应用程序的Microsoft KB。 http://support.microsoft.com/kb/306158 http://support.microsoft.com/kb/306158

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM