繁体   English   中英

BizTalk 2010 Map目标消息显示所有节点

[英]BizTalk 2010 Map destination message show all nodes

我的源架构的元素少于目标架构。 运行地图时,仅显示目标架构中的映射元素。 我希望目标模式中的所有元素都显示出来,即使它们为空。 这个怎么做?

设置输出模式的“默认值”。 这将创建空节点。

最方便的方法是为此使用内联C#脚本功能。

脚本功能:

public string GetEmptyString()
{
    return System.String.Empty;
}

您可以将此函数链接到希望看到空节点的所有输出节点。

例:

输入架构:

<xs:schema xmlns="http://person" targetNamespace="http://person" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Person">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Name" type="xs:string" />
                <xs:element name="Surname" type="xs:string" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

输出架构:

<xs:schema xmlns="http://employee" 
           targetNamespace="http://employee" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Employee">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="FirstName" type="xs:string" />
        <xs:element name="MidName" type="xs:string" />
        <xs:element name="LastName" type="xs:string" />
        <xs:element name="Age" type="xs:string" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

输入信息:

<ns0:Person xmlns:ns0="http://person">
  <Name>John</Name>
  <Surname>Snow</Surname>
</ns0:Person>

预期输出消息:

<ns0:Employee xmlns:ns0="http://employee">
  <FirstName>John</FirstName> 
  <MidName /> 
  <LastName>Snow</LastName> 
  <Age /> 
</ns0:Employee>

解:

  • 将Person.Name链接到Employee.FirstName
  • 将Person.Surname链接到Employee.LastName
  • 创建返回空字符串的脚本功能
  • 将脚本功能链接到Employee.MidName
  • 将脚本功能链接到Employee.Age

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM