BUG: You receive a "Unexpected end of stream" error message when you try to parse a message by using migrated schema in BizTalk Server 2004 (870950)



The information in this article applies to:

  • Microsoft BizTalk Server 2004 Developer Edition
  • Microsoft BizTalk Server 2004 Enterprise Edition
  • Microsoft BizTalk Server 2004 Partner Edition
  • Microsoft BizTalk Server 2004 Standard Edition

SYMPTOMS

When you try to parse a message by using migrated schema in Microsoft BizTalk Server 2004, you may receive an error message that is similar to the following:
Unexpected end of stream while looking for:
'060=' at offset 4
'960' at offset 4
'950' at offset 4
'050=C' at offset 4
'051=P' at offset 4
'998=KIT' at offset 4
'990' at offset 4
'998=END KIT' at offset 4
'999=' at offset 4
'\r\n'
'000' at offset 4
The current definition being parsed is OrderLines. The stream offset where the error occured is 402.
HRESULT: 80131940

RESOLUTION

To work around this problem, remove the root node child delimiter (set to none).

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

Sample schema

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://JunkA.SampleSchema" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://JunkA.SampleSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:appinfo>
      <b:schemaInfo count_positions_by_byte="false" standard="Flat File" root_reference="Root" parser_optimization="complexity" />
      <schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="Root">
    <xs:annotation>
      <xs:appinfo>
        <b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="1" child_order="postfix" child_delimiter_type="char" child_delimiter="," />
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:annotation>
          <xs:appinfo>
            <b:groupInfo sequence_number="0" />
          </xs:appinfo>
        </xs:annotation>
        <xs:element name="Field1" type="xs:string">
          <xs:annotation>
            <xs:appinfo>
              <b:fieldInfo sequence_number="1" justification="left" />
            </xs:appinfo>
          </xs:annotation>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

The BizTalk Server 2004 flat file parser is implemented as an LL(k) Parser or Look-ahead LL Parser. The grammar can be generated from the XSD schema in one of the following two ways:
  • Speed mode: The speed mode lets the user to generate an efficient grammar that minimizes the number of production rules that you must have to represent the flat file structure. The downside of this mode is that complex structures may not parse correctly. The complexity mode generates a grammar that is much more comprehensive and must be used when the structure of the flat file is more complex.
  • Complexity mode: The complexity of a flat file structure increases exponentially as the number of optional children and repeating children and depth increases. The downside of this mode is that parsing can be slower. And, in very complex schemas, the grammar generation and optimization can take a long time. Sometimes the complexity of the grammar causes an out-of-memory condition when performing the grammar optimization.
Because it cannot be dynamically determined which mode best suits a particular schema, Microsoft decided that the better alternative for migrating schemas from BizTalk Server 2000 and BizTalk Server 2002 was to set the parser optimization to speed for the fastest and most efficient processing of the migrated flat file schemas.

Modification Type:MinorLast Reviewed:8/9/2006
Keywords:kbbiztalk2004-2006swept kbtshoot kbbug KB870950 kbAudDeveloper