I am trying to migrate some positional flat file schemas from Seeburger to BizTalk and it seems I am stuck with a problem I do not know how to handle with BizTalk.
I'll try to reduce the complexity to the basic issue I am having.
Let's say that in Seeburger the following message is processed.
Field1----Field2-------Field3----Field4--[CR][LF]
I added padding character "-" here to be visible, and CR LF segment terminator
The seeburger schema has defined the following structure for the above message
Field1 = Min/Max length = 10 characters
Field2 = Min/Max length = 13 characters
Field3 = Min/Max length = 10 characters
Field4 = Min/Max length = 8 characters
All fields are optional so it may be possible to get a message like this only
Field1----Field2-------Field3----[CR][LF]
Until here everything works fine. The problem is that the actual messages received by Seeburger are looking like this for example:
Field1----Field2-------Field3----Field4[CR][LF]
or
Field1----Field2-------Field3[CR][LF]
Please notice that the padding characters are missing from the last element from the record. Seeburger knows to handle this but in BizTalk I am not able to validate a message like this. ( without last element length < length defined in schema )
Biztalk expects that the length of last field from the record to be the defined length in the schema which makes sense. I did tried a lot of things but I was not able to find a solution for this.
Was somebody else stuck on this or do you have any suggestions?
You need to set the Early Termination flag to True on the schema root
Set the Early Terminate Optional Fields to Yes
Make sure all the fields that are optional have the Min Occurs set to 0
For an input file
The schema
Will parse it to below (XML tidied with Notepad++ for readability)