【问题标题】:Web Application, WCF Service and Sharepoint Web ServiceWeb 应用程序、WCF 服务和 Sharepoint Web 服务
【发布时间】:2012-07-23 19:11:39
【问题描述】:

好的,场景是这样的:

我有多个使用 wcf 服务的 Web 应用程序。现在我正在对 wcf 服务进行更改以使用 Sharepoint 2010 Web 服务,即 UserprofileService.asmx

Web 应用程序 -> WCF 服务 -> Sharepoint WebService

问题是,如果我在 wcf 服务中使用以下代码,它可以与 Sharepoint 服务一起正常工作,并且当我从我的机器测试 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 应用程序调用 WCF 服务,因为 Web 应用程序使用以下内容。

<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 服务对话。

最重要的是,我想使用运行 WCF 服务的服务帐户(例如:b2\deltaUser)来访问共享点 userprofile 服务中不同用户的配置文件。我需要使用模拟吗?如果是,我如何在这里使用它。

【问题讨论】:

  • 这听起来可能是“双跳”问题。

标签: c# wcf web-services sharepoint authentication


【解决方案1】:

解决方案很简单。创建两个单独的绑定就可以了。 :)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-23
    相关资源
    最近更新 更多