【问题标题】:BizTalk: Clearing password from send port for custom adapter when exporting binding for applicationBizTalk:导出应用程序绑定时,从自定义适配器的发送端口清除密码
【发布时间】:2012-11-20 23:08:45
【问题描述】:

使用我为 BizTalk Server 2010 制作的适配器导出包含发送端口的应用程序时,我在清除密码时遇到问题。

发送端口使用我制作的适配器,基于 Microsoft.Samples.BizTalk.Adapter.Common BaseAdapter (v.1.0.2)。

TransmitLocation.xsd 和 TransmitHandler.xsd 模式都使用 AdapterFramework 密码特定字段,并且都定义为:

    <xs:element minOccurs="1" default="" name="passwordField">
      <xs:simpleType>
        <xs:annotation>
          <xs:appinfo>
            <baf:designer xmlns:baf="BiztalkAdapterFramework.xsd">
              <baf:category _locID="mailAuthIndstillingerKategori">Password related category</baf:category>
              <baf:displayname _locID="passwordName">Password:</baf:displayname>
              <baf:description _locID="passwordDescription">Password description.</baf:description>
              <baf:editor assembly="%BTSROOT%\\Developer Tools\\Microsoft.BizTalk.Adapter.Framework.dll">Microsoft.BizTalk.Adapter.Framework.ComponentModel.PasswordUITypeEditor</baf:editor>
              <baf:converter assembly="%BTSROOT%\\Developer Tools\\Microsoft.BizTalk.Adapter.Framework.dll">Microsoft.BizTalk.Adapter.Framework.ComponentModel.PasswordTypeConverter</baf:converter>
            </baf:designer>
          </xs:appinfo>
        </xs:annotation>
        <xs:restriction base="xs:string">
          <xs:maxLength value="50" />
        </xs:restriction>
      </xs:simpleType>
    </xs:element>

一些 google-hits 提到在应该被清除的元素上设置 'vt="1"' 属性应该可以解决问题。我尝试在调用 ValidateConfiguration() 时设置/添加此属性。但是配置 XML 作为字符串返回,然后在插入 xml 之前转义,然后在绑定文件中导出。

我尝试在注册表项中指定 SendHandlerPropertiesXMLSendLocationPropertiesXMLAdapterConfig 应使用以下 ,带有 vt="1" 属性,希望它能清除端口的整个绑定属性(不是最佳的,但比让某人导出更好的解决方案密码):

SendHandlerPropertiesXML : <CustomProps><AdapterConfig vt="1"/></CustomProps>
SendLocationPropertiesXML : <CustomProps><AdapterConfig vt="1"/></CustomProps>

导出配置了发送端口的应用程序时,具体的 XML 如下所示:

<TransportTypeData>&lt;CustomProps&gt;&lt;AdapterConfig vt="1"&gt;&amp;lt;Config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&amp;gt;&amp;lt;passwordField vt="1"&amp;gt;CLEARTEXTPASSWORD;lt;/passwordField&amp;gt;&amp;lt;uri&amp;gt;SMTP://NOT-USED&amp;lt;/uri&amp;gt;&amp;lt;/Config&amp;gt;&lt;/AdapterConfig&gt;&lt;/CustomProps&gt;</TransportTypeData>

每次导出绑定时,都会调用适配器的重载方法:ValidateConfiguration(),但无法判断这是何时配置适配器,还是何时导出绑定, 意思是:你不能在返回的 xml-string 中修改密码,因为它也会在配置时修改密码。

还有其他内置适配器可以执行此操作(例如:SMTP 适配器),我确信这是我误解的基本内容。但是任何帮助或指示都会非常有帮助。

【问题讨论】:

  • 我认为导出绑定时从未包含密码。
  • 所有预装 BTS 的适配器都是这种情况。但是,当您制作自己的适配器时,您必须以某种方式告诉 BTS,当绑定中的特定元素(密码)被导出时,它应该将其空白或“加星标”。

标签: binding passwords adapter biztalk baseadapter


【解决方案1】:

我注意到 CodePlex 上的 Blogical Sftp Adapter 完成了这项工作,并且我已经能够复制它。

您所要做的就是在密码元素上添加type="baf:Password"

您可以参考他们的架构here

【讨论】:

    猜你喜欢
    • 2016-11-16
    • 2021-06-28
    • 2010-12-13
    • 2014-04-08
    • 2010-09-24
    • 1970-01-01
    • 2015-10-10
    • 2014-06-10
    • 1970-01-01
    相关资源
    最近更新 更多