[英]Issue migrating custom positional flat file schema from Seeburger to BizTalk
我正在尝试将一些位置平面文件架构从 Seeburger 迁移到 BizTalk,似乎我遇到了一个我不知道如何处理 BizTalk 的问题。
我会尽量减少我遇到的基本问题的复杂性。
假设在 Seeburger 中处理了以下消息。
Field1----Field2-------Field3----Field4--[CR][LF]
我在此处添加了填充字符“-”以使其可见,并且 CR LF 段终止符
seeburger 模式为上述消息定义了以下结构
Field1 = 最小/最大长度 = 10 个字符
Field2 = 最小/最大长度 = 13 个字符
字段 3 = 最小/最大长度 = 10 个字符
Field4 = 最小/最大长度 = 8 个字符
所有字段都是可选的,因此可能只会收到这样的消息
Field1----Field2-------Field3----[CR][LF]
直到这里一切正常。 问题是 Seeburger 收到的实际消息如下所示:
Field1----Field2-------Field3----Field4[CR][LF]
或者
Field1----Field2-------Field3[CR][LF]
请注意,记录的最后一个元素中缺少填充字符。 Seeburger 知道要处理这个问题,但在 BizTalk 中我无法验证这样的消息。 (没有最后一个元素长度<模式中定义的长度)
Biztalk 期望记录中最后一个字段的长度是模式中定义的长度,这是有意义的。 我确实尝试了很多东西,但我无法找到解决方案。
其他人是否坚持这一点,或者您有什么建议?
对于输入文件
Field1----Field2-------Field3----Field4--[CR][LF]
Field1----Field2-------Field3----Field4[CR][LF]
Field1----Field2-------Field3[CR][LF]
Field1----Field2-------[CR][LF]
Field1----Field2[CR][LF]
Field1----[CR][LF]
Field1[CR][LF]
架构
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://Scratch2.Schema.SO73820633" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://Scratch2.Schema.SO73820633" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
<b:schemaInfo standard="Flat File" codepage="65001" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true" allow_early_termination="true" early_terminate_optional_fields="true" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" root_reference="Root" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Root">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_delimiter_type="hex" child_delimiter="0x0D 0x0A" child_order="postfix" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:element maxOccurs="unbounded" name="Record">
<xs:annotation>
<xs:appinfo>
<recordInfo sequence_number="1" structure="positional" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Root_Child1" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" pos_offset="0" pos_length="10" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Root_Child2" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" pos_offset="0" pos_length="13" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Root_Child3" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" pos_offset="0" pos_length="10" sequence_number="3" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Root_Child4" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" pos_offset="0" pos_length="8" sequence_number="4" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
将其解析到下面(使用 Notepad++ 整理的 XML 以提高可读性)
<Root xmlns="http://Scratch2.Schema.SO73820633">
<Record xmlns="">
<Root_Child1>Field1----</Root_Child1>
<Root_Child2>Field2-------</Root_Child2>
<Root_Child3>Field3----</Root_Child3>
<Root_Child4>Field4--</Root_Child4>
</Record>
<Record xmlns="">
<Root_Child1>Field1----</Root_Child1>
<Root_Child2>Field2-------</Root_Child2>
<Root_Child3>Field3----</Root_Child3>
<Root_Child4>Field4</Root_Child4>
</Record>
<Record xmlns="">
<Root_Child1>Field1----</Root_Child1>
<Root_Child2>Field2-------</Root_Child2>
<Root_Child3>Field3</Root_Child3>
</Record>
<Record xmlns="">
<Root_Child1>Field1----</Root_Child1>
<Root_Child2>Field2-------</Root_Child2>
</Record>
<Record xmlns="">
<Root_Child1>Field1----</Root_Child1>
<Root_Child2>Field2</Root_Child2>
</Record>
<Record xmlns="">
<Root_Child1>Field1----</Root_Child1>
</Record>
<Record xmlns="">
<Root_Child1>Field1</Root_Child1>
</Record>
</Root>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.