【问题标题】:Equivalent custom WCF binding for basicHttpBinding with TransportWithMessageCredential security mode具有 TransportWithMessageCredential 安全模式的 basicHttpBinding 的等效自定义 WCF 绑定
【发布时间】:2011-12-02 08:53:21
【问题描述】:

我需要将我的服务器与非 WCF 客户端集成,并建议在标头中更改 SOAP 版本。这可以通过自定义绑定上的<textMessageEncoding messageVersion="Soap11" /> 元素来完成,因此我需要转换我当前的basicHttpBinding。我该怎么做?

<basicHttpBinding>
    <binding>
        <security mode="TransportWithMessageCredential">
            <transport clientCredentialType="Windows"/>
            <message clientCredentialType="UserName" />
        </security>
    </binding>
</basicHttpBinding>

【问题讨论】:

  • BasicHttpBinding 已经包含一个 TextMessageEncodingBindingElement,其 MessageVersion 属性设置为 Soap11,因此您需要自定义绑定的原因似乎是错误的。

标签: .net wcf wcf-binding wcf-security


【解决方案1】:

自定义绑定定义为:

<customBinding>
  <binding name="basicHttpEquivalent">
    <security authenticationMode="UserNameOverTransport" />
    <textMessageEncoding messageVersion="Soap11" />
    <httpsTransport />
  </binding>
</customBinding>

但是这个绑定和你提到的basicHttpBinding完全一样。

【讨论】:

  • 您是否知道在哪里可以找到每个标准绑定的自定义绑定等效项?我想我将要求它能够使用 enableUnsecureResponse 属性。谢谢,丰富
  • @Richard:我正在使用 Reflector 但你可以试试BindingBox
猜你喜欢
  • 2014-07-31
  • 1970-01-01
  • 2011-08-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-05-26
  • 1970-01-01
  • 2018-03-01
相关资源
最近更新 更多