【问题标题】:Impersonation works with asmx but not with svc模拟适用于 asmx,但不适用于 svc
【发布时间】:2011-06-20 19:25:20
【问题描述】:

我的简单 HelloWorld.asmx 工作正常并将我的凭据传递到数据库服务器,但我的 HelloWorld.svc 尝试使用 Web 服务器凭据登录。我有

<identity impersonate="true" />

在 web.config 和 WCF 服务的此绑定中:

  <basicHttpBinding>
    <binding>
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Windows" />
      </security>
    </binding>
  </basicHttpBinding>

asmx 和 svc 都在同一个 IIS7 .Net 4 Web 服务器上。 WCF 还需要模拟什么?

【问题讨论】:

    标签: wcf web-services impersonation


    【解决方案1】:

    好的,知道了。需要 OperationContract 上的这个属性:

        [OperationBehavior(Impersonation = ImpersonationOption.Required)]
    

    【讨论】:

      猜你喜欢
      • 2015-01-05
      • 2017-08-17
      • 1970-01-01
      • 1970-01-01
      • 2012-11-01
      • 2011-03-08
      • 2015-02-13
      • 2011-04-14
      • 2011-03-20
      相关资源
      最近更新 更多