BizTalk Server General - New to Biztalk - Error (Unexpected end of stream) Please help!

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > June 2004 > New to Biztalk - Error (Unexpected end of stream) Please help!





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author New to Biztalk - Error (Unexpected end of stream) Please help!
Tvitello

2004-05-25, 4:37 pm

I'm new to biztalk and am in the process of creating my first flat file
schema for a purchase order file that contains three types of positional
records. Where each record type has a different length followed by CR / LF.
The file can contain multiple Purchase orders.

Control Record - '###PARMVENDPO Y YXYZ' indicates the
start of a new PO (one for each purchase order)
Po Header - Contains Purchase order header information (one for each
purchase order)
Po Line items - Contains Purchase order Line item information (Multiple)

This structure can repeat multiple times within each flat file.

I have a schema that looks like the following:

Root (delimited, postfix,CRLF)
-----Field Attribute (Text)
-----POHead (positional)
-----PODetailGroupRec (delimited, infix, CRLF)
-----PODetail (positional, each header can have multiple details)

Here is what the PO file looks like:

###PARMVENDPO Y YXYZ
XYZ351268025 001EDS030929PRD 92SS1 .
XYZ351268025 002001 0000000000100000000269520007026-6H1 040521 .
XYZ351268025 002002 0000000000100000000022500002624
040521 .
###PARMVENDPO Y YXYZ
XYZ351268026 001EDS030929PRD 92SS1 .
XYZ351268026 002001 0000000000100000000005000001004-5692-A5L 040521 .
XYZ351268026 002002 0000000000100000000092376000276-5773-SPT 040521 .
XYZ351268026 002003 0000000000100000000034056000288-5773-SUB 040521 .
XYZ351268026 002004 0000000000100000000480000006324 040521 .

When I include 1 set of records for a PO, the validate instance works fine.
But when I use a file that has multiple Purchase orders like in the example
above, I get the following error message:

"Unexpected end of stream while looking for: Positional data (length is 1).
The current definition being parsed is PO_Detail. The stream offset where
the error occured is 5858.

I've tried many alterations to the schema and I just can't get to work.
(Also Posted in BT General)


Does anyone have any experience with this that they are willing to share?

Thanks in advance!
Tony



David Downing [MSFT]

2004-05-25, 4:37 pm

What this error is telling you is that as the parser consumes the data and
fills the individual fields, suddenly the stream ended when there is more
required data. In the case of positional records, positional fields are
data agnostic, and will consume any data that lies within the length of the
positional field, in your case this also includes <CR><LF> characters. The
one exception to this rule is if you have added the
allow_early_termination="true" annotation to the schemaInfo node of your
schema (this must be added manually using a text editor). By doing this,
the parser will treat the right-most positional field as a delimited field
and allow this field to be less than the length of the positional field
definition. In addition, trailing optional fields can also be present, as
long as the length of all trailing fields up to but not including the
right-most field are completely filled with data.

Check to make sure that the data for each instance is not longer than
expected, if it is, and you are not using tags to identify individual
records, you will essentially start parsing a new record.

If you continue to have problems, zip up your schema and test data for us
to take a look at.

Dave

--
This posting is provided "AS IS" with no warranties, and confers no rights.

David Downing [MSFT]

2004-05-30, 10:46 am

Tony,

I took a look at your schema and data and noticed several things that are
causing you problems. For each of your positional records, you don't have
any information the parser can use to identify which record is being
parsed, and because the last positional record repeats, the parser assumes
all trailing data belongs to to PO_Detail record. Another problem I can
see is that the first record in the instance is postfix <CR><LF> for the
children, and the next record is infix <CR><LF> for the children. In
addition an infix <CR><LF> delimiter also delimits each instance of the
record. I'm attaching a schema and updated instance file that can give
you an idea how you might be able to parse this type of data. Basically
what I did was change the root record and PORequestRecord to postfix.

Hope that helps get you started.

Dave
Tvitello

2004-05-30, 10:46 am

David,

I don't see the Schema Attachment.

The only attachement that I see is the test file.

Tony

"David Downing [MSFT]" <ddowning@online.microsoft.com> wrote in message
news:QwTTOqzQEHA.3996@cpmsftngxa10.phx.gbl...
> Tony,
>
> I took a look at your schema and data and noticed several things that are
> causing you problems. For each of your positional records, you don't have
> any information the parser can use to identify which record is being
> parsed, and because the last positional record repeats, the parser assumes
> all trailing data belongs to to PO_Detail record. Another problem I can
> see is that the first record in the instance is postfix <CR><LF> for the
> children, and the next record is infix <CR><LF> for the children. In
> addition an infix <CR><LF> delimiter also delimits each instance of the
> record. I'm attaching a schema and updated instance file that can give
> you an idea how you might be able to parse this type of data. Basically
> what I did was change the root record and PORequestRecord to postfix.
>
> Hope that helps get you started.
>
> Dave



alex3wworld

2004-06-09, 5:01 pm

I get the same error.
Here what I am trying to do:
I have a flat-file positioned with a structure like this:

version 00210
record1 somestringdata somestringdata somestringdata somestringdata
record2 somestringdata somestringdata somestringdata somestringdata
******
******
******
*

where the last * is a CRLF and each record delimited by CRLF.
When I try to validate instance, I got this error: "Unexpected end of stream while looking for: Positional data (length is 8)the current definition being parsed is ExportData. The stream offset where the error occured is 432."
the 432 position is the place of the last delimiter.
I tried to add this statement to the schema annotations (allow_early_termination="true" ), but have no results!
Also, If I will change my source file and lieve only 1 record and if I set Max number to 1 - I have no errors at all.

Alex.

David Downing [MSFT]

2004-06-20, 11:07 pm

Alex,

Can you attach your schema and instance data for us to take a look at?

--
Dave

This posting is provided "AS IS" with no warranties, and confers no rights.

"alex3wworld" <anonymous@discussions.microsoft.com> wrote in message
news:2CCAA83C-D400-4A08-A42C-52CABB1B9754@microsoft.com...
> I get the same error.
> Here what I am trying to do:
> I have a flat-file positioned with a structure like this:
>
> version 00210
> record1 somestringdata somestringdata somestringdata

somestringdata
> record2 somestringdata somestringdata somestringdata

somestringdata
> ******
> ******
> ******
> *
>
> where the last * is a CRLF and each record delimited by CRLF.
> When I try to validate instance, I got this error: "Unexpected end of

stream while looking for: Positional data (length is 8)the current
definition being parsed is ExportData. The stream offset where the error
occured is 432."
> the 432 position is the place of the last delimiter.
> I tried to add this statement to the schema annotations

(allow_early_termination="true" ), but have no results!
> Also, If I will change my source file and lieve only 1 record and if I set

Max number to 1 - I have no errors at all.
>
> Alex.
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com