none
EDI Custom Pipeline Component - Error: Missing or invalid or duplicate Transaction set identifier RRS feed

  • Question

  • Hello All!!

     

    In these days I have been experimenting an EDI Error regarding ISA12 (interchange control version number)

     

    Biztalk is throwing an error regarding "Invalid versionId" when an Inbound Message has the 00503 value on ISA12 element like this:

                   ISA*04*SW426     *00*          *02*RRDC           *02*KCS            *080512*1247*U*00503*001651461*0*P*;~

    Errors:

       Invalid VersionId

       Invalid code value

     

    I have not found a solution yet to solve this, so I decided to create an EDI Custom Pipeline Component in order to modify the ISA12 from Inbound Message. However I´m getting the error:  Missing or invalid or duplicate Transaction set identifier

     

    Do you have any comment to solve this?  Any thing will be appreciated it,

    Thanks in advance

    Pablo

     

    This is part of my custom code on Decoder Stage:

     

    public IBaseMessage Execute(IPipelineContext pc,  IBaseMessage inmsg)
    {
                string originalEDI = string.Empty;
                string outboundEDI = string.Empty;
                int numberBytesToRead = 0;
                int numberBytesRead = 0;
                byte[] outBytes = null;
                byte[] ediBytes = null;
                MemoryStream memStream = null;
                


                IBaseMessagePart bodyPart = inmsg.BodyPart;

                try
                {

                   Stream originalStream = bodyPart.GetOriginalDataStream();

                   numberBytesToRead = (int)originalStream.Length;
                   numberBytesRead = 0;

                   while (numberBytesToRead > 0)
                   {
                     outBytes = new byte[numberBytesToRead];

                     // Read may return anything from 0 to numBytesToRead.
                     int bytes = originalStream.Read(outBytes, numberBytesRead, numberBytesToRead);

                      // The end of the file is reached.
                      if (bytes == 0)
                           break;
                      else
                      {
                        outboundEDI += System.Text.Encoding.Default.GetString(outBytes);
                      }

                        numberBytesRead += bytes;
                        numberBytesToRead -= bytes;
                   

                   }               

     

                    //Replace the ISA12.  '*' is a segment separator
                    string[] splitEDI = outboundEDI.Split(new Char[] { '*' });
                    if (splitEDI.Length > 0 && splitEDI[12] != null)
                    {
                      outboundEDI = outboundEDI.Replace(splitEDI[12].ToString(), "00502");
                    }                       

                          

                     memStream = new MemoryStream();


                     //Get the Bytes for the new EDI.
                     ediBytes = System.Text.Encoding.Default.GetBytes(outboundEDI);


                     memStream.Write(ediBytes, 0, ediBytes.Length);
                   
      memStream.Seek(0, SeekOrigin.Begin);
                     bodyPart.Data = memStream;

                     pc.ResourceTracker.AddResource(memStream);

                }
                catch (Exception exception)
                {
                    throw exception;
                }
                finally
                {
                    outboundEDI = null;
                    outBytes = null;
                    ediBytes = null;
                }

                return inmsg;
            }

    Monday, May 26, 2008 11:26 PM

Answers

  •  

    Thanks to Everybody,

     

    I appreciated your comments and suggestions. They have been very helpful.

     

    I have finally found the solution.  Let me explain:

     

    As I told you, I´m modifying the ISA12 when its has 00503 value due to Biztalk is throwing the error: "Invalid VersionId" and "Invalid code on ISA12", I do not know if Biztalk can support EDI interchange using this version yet; however I decided on create a Custom Pipeline component on decoder stage.

     

    Once I modified the ISA12 with the value: "00502", Biztalk was throwing the error: "Missing or invalid or duplicate Transaction set identifier", The issue is that as I modified to lower version to 00503 Biztalk needs to have deployed on my application that schema version, I mean:  X12_00502_426.xsd.  When I deployed that schema in my application the message was processed by Biztalk correctly.

     

    I did not like this solution because I must now use this schema version in my application and I was using X12_00503_426.xsd, however as I have not found another way yet.

     

    If you have any comments will be appreciated,

    Thanks again,

    Regards

    Pablo

    Friday, May 30, 2008 1:46 PM

All replies

  • Check your string replacement logic, i.e. the output you get after replacing with 00502. Also try creating a new message that is returned from Execute rather than modifying the imput message.

     

    Koushik

    Tuesday, May 27, 2008 12:18 PM
  • May be following error description help you:

     http://msdn.microsoft.com/en-us/library/bb967857.aspx

     

    This Error/Warning/Information event indicates that the receive or send pipeline could not process the X12 interchange because the value of the transaction set identifier (in the ST01 field) was missing, a duplicate, or had an invalid value. This can occur if the document schema does not have an ST header and an SE trailer.

    To resolve this error, make sure that the interchange has a value for the ST01 field and that the schema has an entry for the ST header and SE trailer. Verify that the value of ST01 is a valid three-digit document-type designator. Verify that the ST01 field is not a duplicate with the ST01 field of another transaction set.

    Thursday, May 29, 2008 12:14 PM
  •  

    Thanks to Everybody,

     

    I appreciated your comments and suggestions. They have been very helpful.

     

    I have finally found the solution.  Let me explain:

     

    As I told you, I´m modifying the ISA12 when its has 00503 value due to Biztalk is throwing the error: "Invalid VersionId" and "Invalid code on ISA12", I do not know if Biztalk can support EDI interchange using this version yet; however I decided on create a Custom Pipeline component on decoder stage.

     

    Once I modified the ISA12 with the value: "00502", Biztalk was throwing the error: "Missing or invalid or duplicate Transaction set identifier", The issue is that as I modified to lower version to 00503 Biztalk needs to have deployed on my application that schema version, I mean:  X12_00502_426.xsd.  When I deployed that schema in my application the message was processed by Biztalk correctly.

     

    I did not like this solution because I must now use this schema version in my application and I was using X12_00503_426.xsd, however as I have not found another way yet.

     

    If you have any comments will be appreciated,

    Thanks again,

    Regards

    Pablo

    Friday, May 30, 2008 1:46 PM
  • Hi Pablo,

     

    I have the same problem where I need to alter information within the ISA header. I am thinking of using a custom pipeline component but was wondering if you still ended up using the EdiReceive pipeline that comes with BizTalk Server 2006 R2?

     

    Regards

    Friday, November 7, 2008 10:41 PM
  • Hi Sirgini;

     

    I created a custom edi receive pipeline component by using the EDI dissambler.

     

    I can share you my code. Please send me your email to fuentesrdz@hotmail.com

     

    Thank you

    Saturday, November 8, 2008 12:01 AM