Validate 271 response before calling X12Writer

Post author
Nicholas Migliaccio

I am building a 271 and i would like to Validate the Transactions prior to serializing it using the X12Writer.

 

The problem is that I am not explicitly creating / assigning an SE Transaction Set Trailer segment, based on the understanding that the X12Writer creates that for you.  The Validate fails stating :

[271 with control nmbr 'xxxxx'] MessageTrailerMissing

Comments

1 comment

  • Comment author
    Admin

    Hello,

    You should use the IsValid() overload like this:

    MessageErrorContext errorContext;
    if (!purchaseOrder.IsValid(out errorContext, true))

    The second parameter, "true", tells the validator to skip over the trailers check.

    0

Please sign in to leave a comment.