[英]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>
解:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.