0

さて、シナリオは次のようになります。

wcf サービスを使用する複数の Web アプリケーションがあります。そして今、Sharepoint 2010 Web サービス、つまり UserprofileService.asmx を使用するように wcf サービスに変更を加えています。

Web アプリケーション -> WCF サービス -> Sharepoint WebService

問題は、wcf サービスで以下のコードを使用すると、Sharepoint サービスで正常に動作し、自分のマシンから wcf サービスをテストすると、sharepoint ユーザープロファイル サービスで利用可能なメソッドにアクセスできることです。

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>

既存のすべてのアプリケーションと通信でき、同時に Sharepoint Service と通信できるように、WCF サービスを構成する方法が必要です。

最も重要なことは、WCF サービスが実行されているサービス アカウント (例: b2\deltaUser) を使用して、共有ポイント userprofile サービスのさまざまなユーザーのプロファイルにアクセスすることです。偽装を使用する必要がありますか? はいの場合、ここでどのように使用できますか。

4

1 に答える 1

0

解決策は簡単でした。2 つの個別のバインディングを作成することで、うまくいきました。:)

于 2012-09-06T21:16:46.137 に答える