Custom EDI Disassembler RRS feed

  • Question

  • Hi Everyone,

    I am currently looking for a way to process both 4010 and 5010 835 remittance files that will be dropped into one receive location.  I know the EDI Disassembler component has a property "Usa ISA11 as a Repetition Separator" that you can set at design time: true for processing 5010 files & false for 4010.  Because both 4010 and 5010 files will be dropped into the same location with the same file naming convention, I need to determine what version of the file I am processing dynamically and be able to set the 'UseIsa11AsRepetitionSeparator' property dynamically as well.

    I have created a custom pipeline component disassembler that inherits the native EDI Disassembler, then in the Disassemble() method I read the in the ISA12 element to determine the version and set the 'UseIsa11AsRepetitionSeparator' property accordingly.  I then call the base.Disassemble method to do the EDI disassembling.  When deploy the component and drop an 835 file into the receive location, I receive this error message: "The Messaging Engine encountered an error during the processing of one or more inbound messages."  In the event log I also receive this error message: "The receive pipeline: "xxx" for receive location: "C:\drop_location\" is trying to explicitly suspend a message that has a non-seekable stream.".

    To be sure, if i replace my custom disassembler with the native EDI Disassembler in my receive pipeline it processes the file properly (depending on what version of the file I drop in the receive location & the value of the 'UseIsa11AsRepetitionSeparator' property I set at design time.)


    <pre lang="x-c#">[ComponentCategory(CategoryTypes.CATID_PipelineComponent)]
        public class CustomEdiDisassembler : EdiDisassembler, IBaseComponent, IDisassemblerComponent
            #region IDisassemblerComponent members
            public new void Disassemble(IPipelineContext pContext, Microsoft.BizTalk.Message.Interop.IBaseMessage pInMsg)
                IBaseMessagePart message = pInMsg.BodyPart;
                if (message != null)
                    Stream contentStream = message.GetOriginalDataStream();
                    string content = Encoding.ASCII.GetString(ToByteArray(contentStream)); //private version to get EDI content
                    if(GetVersion(content) == "00501") //private method to retrieve value of ISA12
                        base.UseIsa11AsRepetitionSeparator = true;
                base.Disassemble(pContext, pInMsg);


    First, is this an okay way of processing both 4010/5010 files dynamically?

    Second, does anyone know why I am getting these errors?


    Thanks in advance.

    Tuesday, November 8, 2011 6:53 PM

All replies

  • I believe you should be able to control this behavior using parties and agreements, if there is any differences in the ISA segment of the two message types?

    If so you should be able to create an agreements for each messagetype and then under interchange settings->Envelopes set the ISA11 Usage.

    If there are no differences between the ISA segments, you can manipulate them and create a difference in a custom pipeline component implemented before the receive pipeline enters the EDIDisassembler.


    Morten la Cour


    Tuesday, November 22, 2011 9:57 AM
  • Need to reset pInMsg - I see where you read the stream - but don't see where the stream was reset before passing to Disassemble

    try something like this:

    Stream newMsg= new MemoryStream(ASCIIEncoding.Default.GetBytes(content)); //create a new IBaseMessage using the [content] message use for processing

    base.Disassemble(pContext, newMsg); //Pass the new message stream message

    Monday, November 21, 2016 12:58 AM
  • Well, this should be an issue since the ISA versions should be different.

    Are the Sender and Receiver Identifiers the same?

    Monday, November 21, 2016 3:04 PM
  • Hi,

    Try the following to resolve the issue.

            ReadOnlySeekableStream seekableStream = null;

            IBaseMessagePart bodyPart = pInMsg.BodyPart;

            if (message != null)
                seekableStream = new ReadOnlySeekableStream(bodyPart.GetOriginalDataStream());

                string content = Encoding.ASCII.GetString(ToByteArray(contentStream)); //private version to get EDI contentif(GetVersion(content) == "00501") //private method to retrieve value of ISA12base.UseIsa11AsRepetitionSeparator = true;

                if (GetVersion(content) == "00501") //private method to retrieve value of ISA12
                    base.UseIsa11AsRepetitionSeparator = true;

            seekableStream.Seek(0, SeekOrigin.Begin);

    pInMsg.BodyPart.Data = seekableStream;


            base.Disassemble(pContext, pInMsg);


    • Edited by Gnani.._ Thursday, January 12, 2017 9:33 PM
    Thursday, January 12, 2017 9:33 PM
  • Is this a new question or are you working with lance_uppercut?

    If it's new, please start a new thread.  If not, first I will say, do not do this.

    Sorry, this a very, very poor way of handling this situation.

    Friday, January 13, 2017 9:46 PM