【问题标题】:Translate non-BizTalk WCF config into BizTalk WCF-Custom endpoint将非 BizTalk WCF 配置转换为 BizTalk WCF 自定义终结点
【发布时间】:2014-02-20 07:25:58
【问题描述】:

我有一个正在运行的 BizTalk 应用程序,该应用程序当前正在使用 WCF-BasicHttp 适配器。它目前仅使用使用 UserName 凭据类型的消息安全性,并且一切正常。

此后情况发生了变化,我们现在需要在传输 (IIS) 级别接受客户端证书以对服务进行授权,并且仍继续使用消息安全性来对服务进行身份验证。

经过大量的痛苦和搜索,我能够根据我的 this post 的位配置使其在非 BizTalk WCF 环境中工作,并最终得到以下 customBinding 配置:

<customBinding>
    <binding name="CustomCDARequestEndpointBinding">                    
      <textMessageEncoding messageVersion="Soap11" />
      <security authenticationMode="UserNameOverTransport" />
      <httpsTransport requireClientCertificate="true" />
    </binding>
  </customBinding>

这导致 WCF 客户端配置如下:

<customBinding>
    <binding name="CDARequestEndpoint">
      <security defaultAlgorithmSuite="Default" authenticationMode="UserNameOverTransport"
        requireDerivedKeys="true" includeTimestamp="true" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
        <localClientSettings detectReplays="false" />
        <localServiceSettings detectReplays="false" />
      </security>
      <textMessageEncoding messageVersion="Soap11" />
      <httpsTransport requireClientCertificate="true" />
    </binding>
  </customBinding>
</bindings>
<behaviors>
  <endpointBehaviors>
    <behavior name="ohBehave">
      <clientCredentials useIdentityConfiguration="false">
        <clientCertificate findValue="6D0DBF387484B25A16D0E3E53DBB178A366DA954" storeLocation="CurrentUser"
          x509FindType="FindByThumbprint" />
      </clientCredentials>
    </behavior>
  </endpointBehaviors>
</behaviors>  

这在非 BizTalk 环境中工作得非常好,而且由于 requreClientCertificate 属性,它似乎是配置的关键部分是 &lt;httpsTransport requireClientCertificate="true" /&gt; 配置元素。问题是,无论我尝试什么,我都无法在任何地方的 BizTalk WCF-Custom/customBinding 配置中找到类似的设置。我无法添加 &lt;httpsTransport&gt; 绑定元素扩展,因为它在 BizTalk 中不作为 on 选项存在

有人知道我的选择吗?

  • 我可以直接编辑 web.config 吗?
  • 是否可以添加另一个扩展来在 BizTalk GUI 中实现相同的效果?
  • 我可以在编排中编写代码以按照我建议的方式手动设置此接收位置吗?

【问题讨论】:

    标签: c# wcf biztalk wcf-binding


    【解决方案1】:

    由于 WCF-BasicHttp 适配器仅显示某些属性,因此您不能将其用于您的目的。

    改为:

    1. 从 WCF 自定义适配器开始
    2. BindingType = customBinding
    3. 删除httpTransport
    4. 添加 httpsTransport(然后您将看到 requireClientCertificate)
    5. 添加 clientCredentials Behavior 并在 Credentials 选项卡中设置您的选项和凭据。

    【讨论】:

    • 我想我不清楚我已经在使用 WCF 自定义适配器...我什至没有想到做的一件事是删除 httpTransport...更不用说它会暴露httpsTransport。这给了我希望!
    • 船家做到了!虽然现在看起来很明显,当 httpTransport 已经存在时,GUI 不会向您显示 httpsTransport 元素,但当您第一次进入 customBinding 配置屏幕时,这似乎并不明显,这是肯定的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-12
    • 1970-01-01
    • 2012-08-25
    • 1970-01-01
    • 2012-03-19
    • 2021-02-26
    • 2011-08-07
    相关资源
    最近更新 更多