【发布时间】: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 作为字符串返回,然后在插入
我尝试在注册表项中指定 SendHandlerPropertiesXML 和 SendLocationPropertiesXML 的 AdapterConfig 应使用以下
SendHandlerPropertiesXML : <CustomProps><AdapterConfig vt="1"/></CustomProps>
SendLocationPropertiesXML : <CustomProps><AdapterConfig vt="1"/></CustomProps>
导出配置了发送端口的应用程序时,具体的 XML 如下所示:
<TransportTypeData><CustomProps><AdapterConfig vt="1">&lt;Config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;passwordField vt="1"&gt;CLEARTEXTPASSWORD;lt;/passwordField&gt;&lt;uri&gt;SMTP://NOT-USED&lt;/uri&gt;&lt;/Config&gt;</AdapterConfig></CustomProps></TransportTypeData>
每次导出绑定时,都会调用适配器的重载方法:ValidateConfiguration(),但无法判断这是何时配置适配器,还是何时导出绑定, 意思是:你不能在返回的 xml-string 中修改密码,因为它也会在配置时修改密码。
还有其他内置适配器可以执行此操作(例如:SMTP 适配器),我确信这是我误解的基本内容。但是任何帮助或指示都会非常有帮助。
【问题讨论】:
-
我认为导出绑定时从未包含密码。
-
所有预装 BTS 的适配器都是这种情况。但是,当您制作自己的适配器时,您必须以某种方式告诉 BTS,当绑定中的特定元素(密码)被导出时,它应该将其空白或“加星标”。
标签: binding passwords adapter biztalk baseadapter