BizTalk - 平头文件与头多个记录和页脚 - 反汇编问题 [英] BizTalk - Flat file with Header multiple records and Footer - Disassemble problem

查看:169
本文介绍了BizTalk - 平头文件与头多个记录和页脚 - 反汇编问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有平面文件架构(下面的描述),我通过自定义管道获得平面文件(下面的描述),平面文件无法反汇编阶段,出现以下错误:
意外的流结束,而
寻找:
'\r\\\
'
被解析的当前定义是Root。发生错误的流偏移量是202.发生错误的行号是5.发生错误的列是0.
HRESULT:80131940



我尝试了各种选项(孩子的顺序,孩子分隔符等),但都失败了相同的错误。
我不能使用标签标识符,因为页脚和记录以相同的字符开始。



我必须在编排中获得完整的消息,我不能使用页眉,页脚预告片(预告片总是丢失)。
$ b

架构:



 <?xml version =1.0encoding =utf-16?> 
< xs:annotation>
< xs:appinfo>
< schemaEditorExtension:schemaInfo namespaceAlias =bextensionClass =Microsoft.BizTalk.FlatFileExtension.FlatFileExtensionstandardName =Flat Filexmlns:schemaEditorExtension =http://schemas.microsoft.com/BizTalk/2003/ SchemaEditorExtensions/>
< / xs:appinfo>
< / xs:annotation>
< xs:element name =Root>
< xs:annotation>
< xs:appinfo>
< / xs:appinfo>
< / xs:annotation>
< xs:complexType>
< xs:sequence>
< xs:annotation>
< xs:appinfo>
< b:groupInfo sequence_number =0/>
< / xs:appinfo>
< / xs:annotation>
< xs:element minOccurs =1maxOccurs =1name =Header>
< xs:annotation>
< xs:appinfo>
< / xs:appinfo>
< / xs:annotation>
< xs:complexType>
< xs:sequence>
< xs:annotation>
< xs:appinfo>
< b:groupInfo sequence_number =0/>
< / xs:appinfo>
< / xs:annotation>
< xs:element name =Header_Child1type =xs:string>
< xs:annotation>
< xs:appinfo>
< b:fieldInfo justification =leftpos_offset =0pos_length =15sequence_number =1/>
< / xs:appinfo>
< / xs:annotation>
< / xs:element>
< xs:element name =Header_Child2type =xs:string>
< xs:annotation>
< xs:appinfo>
< b:fieldInfo justification =leftpos_offset =0pos_length =15sequence_number =2/>
< / xs:appinfo>
< / xs:annotation>
< / xs:element>
< xs:element name =Header_Child3type =xs:string>
< xs:annotation>
< xs:appinfo>
< b:fieldInfo justification =leftpos_offset =0pos_length =15sequence_number =3/>
< / xs:appinfo>
< / xs:annotation>
< / xs:element>
< / xs:sequence>
< / xs:complexType>
< / xs:element>
< xs:element minOccurs =0maxOccurs =unboundedname =Record>
< xs:annotation>
< xs:appinfo>
< / xs:appinfo>
< / xs:annotation>
< xs:complexType>
< xs:sequence>
< xs:annotation>
< xs:appinfo>
< b:groupInfo sequence_number =0/>
< / xs:appinfo>
< / xs:annotation>
< xs:element name =Record_Child1type =xs:string>
< xs:annotation>
< xs:appinfo>
< b:fieldInfo justification =leftpos_offset =0pos_length =18sequence_number =1/>
< / xs:appinfo>
< / xs:annotation>
< / xs:element>
< xs:element name =Record_Child2type =xs:string>
< xs:annotation>
< xs:appinfo>
< b:fieldInfo justification =leftpos_offset =0pos_length =18sequence_number =2/>
< / xs:appinfo>
< / xs:annotation>
< / xs:element>
< xs:element name =Record_Child3type =xs:string>
< xs:annotation>
< xs:appinfo>
< b:fieldInfo justification =leftpos_offset =0pos_length =16sequence_number =3/>
< / xs:appinfo>
< / xs:annotation>
< / xs:element>
< / xs:sequence>
< / xs:complexType>
< / xs:element>
< xs:element minOccurs =1maxOccurs =1name =Footer>
< xs:annotation>
< xs:appinfo>
< / xs:appinfo>
< / xs:annotation>
< xs:complexType>
< xs:sequence>
< xs:annotation>
< xs:appinfo>
< b:groupInfo sequence_number =0/>
< / xs:appinfo>
< / xs:annotation>
< xs:element name =Footer_Child1type =xs:string>
< xs:annotation>
< xs:appinfo>
< b:fieldInfo justification =leftpos_offset =0pos_length =15sequence_number =1/>
< / xs:appinfo>
< / xs:annotation>
< / xs:element>
< xs:element name =Footer_Child2type =xs:string>
< xs:annotation>
< xs:appinfo>
< b:fieldInfo justification =leftpos_offset =0pos_length =15sequence_number =2/>
< / xs:appinfo>
< / xs:annotation>
< / xs:element>
< xs:element name =Footer_Child3type =xs:string>
< xs:annotation>
< xs:appinfo>
< b:fieldInfo justification =leftpos_offset =0pos_length =15sequence_number =3/>
< / xs:appinfo>
< / xs:annotation>
< / xs:element>
< / xs:sequence>
< / xs:complexType>
< / xs:element>
< / xs:sequence>
< / xs:complexType>
< / xs:element>
< / xs:schema>

平面文件样本

 头字段1头字段2头字段3 
记录1字段1记录1字段2记录1字段3
记录2字段1记录2字段2记录2字段3
页脚字段1页脚字段2页脚字段3

谢谢,
Asaf <我可能会在这里错过一些东西,但我不知道。不认为你可以做你想做的事情 -

你有一个标题记录,其中有一个,所以BizTalk可以处理 - 它可以假设第一条记录是标题记录,根据模式正确解析。

然后,你有一个无限的记录集合,而BizTalk也很好地处理这些记录 - 它会试图解析每一个记录,如记录和取决于Child Order属性,它会在每个记录之后和文件的末尾处指定一个分隔符。



然后你有一个页脚记录,但没有标签标识符BizTalk不知道何时尝试解析记录作为页脚记录。它没有文件中的最后一行的概念。

所以它将头标记录之后的所有记录解析为记录然后留下一个看似缺少的页脚记录。

解决这个问题的方法是为记录类型提供一个标签,至少在页脚中是这样。

我已经在脚注记录中添加了Footer标签,并正确解析了文件(再次 - 根据Child的值,最后需要回车订单财产



我希望这是有道理的



Yossi


I have flat file schema (description below), I am getting flat file(description below) through custom pipeline, the flat file fails disassemble phase with the following error: Unexpected end of stream while looking for: '\r\n' The current definition being parsed is Root. The stream offset where the error occurred is 202. The line number where the error occurred is 5. The column where the error occurred is 0. HRESULT: 80131940

I tried various options (child order, child delimiter etc.) but all fails with the same error. I can't use tag identifier because the footer and record starts with the same characters.

I have to get the full message in the orchestration, there for I can't use header, footer trailer (the trailer always dropped).

Schema:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://BizTalk_Server_Project1.FlatFileSchema1" targetNamespace="http://BizTalk_Server_Project1.FlatFileSchema1" 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="false" early_terminate_optional_fields="false" 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" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="infix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:annotation>
          <xs:appinfo>
            <b:groupInfo sequence_number="0" />
          </xs:appinfo>
        </xs:annotation>
        <xs:element minOccurs="1" maxOccurs="1" name="Header">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="positional" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <b:groupInfo sequence_number="0" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="Header_Child1" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="15" sequence_number="1" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="Header_Child2" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="15" sequence_number="2" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="Header_Child3" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="15" sequence_number="3" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Record">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="positional" sequence_number="2" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <b:groupInfo sequence_number="0" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="Record_Child1" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="18" sequence_number="1" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="Record_Child2" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="18" sequence_number="2" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="Record_Child3" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="16" sequence_number="3" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="1" maxOccurs="1" name="Footer">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="positional" sequence_number="3" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <b:groupInfo sequence_number="0" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="Footer_Child1" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="15" sequence_number="1" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="Footer_Child2" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="15" sequence_number="2" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="Footer_Child3" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="15" sequence_number="3" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Flat file sample:

Header Field1  Header Field2  Header Field3  
Record 1 Field 1  Record 1 Field 2  Record 1 Field 3
Record 2 Field 1  Record 2 Field 2  Record 2 Field 3
Footer Field1  Footer Field2  Footer Field3 

Thanks, Asaf

解决方案

Yakov,

I might be missing something here, but I don’t think you can do what you try to do –

You have a header records, of which there is one, and so BizTalk can handle that – it can assume the first record is a header record and parse it correcly according to the schema.

Then you have an unbounded set of records for 'Record', and BizTalk handles those nicely as well - it will try to parse every other record as as 'Record' and depending on the Child Order property it will expect a delimiter after each record and at the end of file or not.

Then you have a footer record, but with no tag identifiers BizTalk have no idea when to try and parse the record as a footer record. it doesn't have the concept of - 'the last line in the file'.

And so it parses all the records after the header record as a 'record', and then is left looking for a seemingly missing footer record.

The way to solve this is to provide a tag for the record types, in your example at least for the footer.

I've added the 'Footer' tag to the footer record and the file parsed correctly (again - carriage return in the end is needed depending on the value of the Child Order property

I hope this makes sense

Yossi

这篇关于BizTalk - 平头文件与头多个记录和页脚 - 反汇编问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆