我正在尝试处理 X12 278 消息的响应消息,并且正在生成的 XML 似乎没有正确遵循架构。
当原始/原生格式通过 EDI 管道运行时,消息如下所示:
<ns0:X12_00501_278 xmlns:ns0="http://schemas.microsoft.com/BizTalk/EDI/X12/2006">
<ST>
<ST01_TransactionSetIdentifierCode>278</ST01_TransactionSetIdentifierCode>
<ST02_TransactionSetControlNumber>0001</ST02_TransactionSetControlNumber>
<ST03_ImplementationGuideVersionName>005010X216</ST03_ImplementationGuideVersionName>
</ST>
<ns0:BHT_BeginningofHierarchicalTransaction_TS278A1>
<BHT01_HierarchicalStructureCode>0007</BHT01_HierarchicalStructureCode>
<BHT02_TransactionSetPurposeCode>44</BHT02_TransactionSetPurposeCode>
<BHT03_SubmitterTransactionIdentifier>123456789</BHT03_SubmitterTransactionIdentifier>
<BHT04_TransactionSetCreationDate>20120313</BHT04_TransactionSetCreationDate>
<BHT05_TransactionSetCreationTime>1108</BHT05_TransactionSetCreationTime>
</ns0:BHT_BeginningofHierarchicalTransaction_TS278A1>
该消息应如下所示:
<ns0:X12_00501_278 xmlns:ns0="http://schemas.microsoft.com/BizTalk/EDI/X12/2006">
<ST>
<ST01_TransactionSetIdentifierCode>278</ST01_TransactionSetIdentifierCode>
<ST02_TransactionSetControlNumber>0001</ST02_TransactionSetControlNumber>
<ST03_ImplementationGuideVersionName>005010X216</ST03_ImplementationGuideVersionName>
</ST>
<A3_BHT_Loop>
<ns0:BHT_BeginningofHierarchicalTransaction_TS278A3>
<BHT01_HierarchicalStructureCode>0007</BHT01_HierarchicalStructureCode>
<BHT02_TransactionSetPurposeCode>44</BHT02_TransactionSetPurposeCode>
<BHT03_SubmitterTransactionIdentifier>123456789</BHT03_SubmitterTransactionIdentifier>
<BHT04_TransactionSetCreationDate>20120313</BHT04_TransactionSetCreationDate>
<BHT05_TransactionSetCreationTime>1108</BHT05_TransactionSetCreationTime>
</ns0:BHT_BeginningofHierarchicalTransaction_TS278A3>
在后一个示例中,请注意包含 *A3_BHT_Loop* 元素以及 BHT 段现在正确标记为 *BHT_BeginningofHierarchicalTransaction_TS278A3* 的事实。
是否需要进行设置才能使消息解析为正确的架构?或者响应消息中是否应该包含一些内容以让管道检测应该应用哪种格式?