[英]Web Application, WCF Service and Sharepoint Web Service
好的,場景如下所示:
我有多個Web應用程序,它消耗的WCF服務。 現在我要更改wcf服務以使用Sharepoint 2010 Web服務,即UserprofileService.asmx
Web應用程序-> WCF服務-> Sharepoint WebService
問題是如果我在wcf服務中使用下面的代碼,它可以與Sharepoint Service一起正常工作,並且當我從計算機上測試wcf服務時,我能夠訪問sharepoint userprofile服務中可用的方法。
C#
service.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
service.ChannelFactory.Credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;
Web.config
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
但是由於Web應用程序使用以下內容,因此我不再能夠從Web應用程序調用WCF服務。
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="">
<extendedProtectionPolicy policyEnforcement="Never"/>
</transport>
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true"/>
</security>
我需要一種以這種方式配置WCF服務的方法,使其仍然能夠與所有現有應用程序進行通信,並能夠同時與Sharepoint Service進行通信。
最重要的是,我想使用運行WCF服務的服務帳戶(例如:b2 \\ deltaUser)來訪問共享點用戶配置文件服務中不同用戶的配置文件。 我需要使用模擬嗎? 如果是,我如何在這里使用它。
解決方案很簡單。 創建兩個單獨的綁定就可以了。 :)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.