Error on parsing D96A Order on a particular segment!

Nov 7, 2013 at 1:46 PM
Hi there,

I am trying to parse an EDI order D96A I received as a test order from a client. The problem is I am getting an object reference not set error in the ParsingContextBuilder when it is trying to parse certain segments. One in particular is PIA, for some reason it throws an error when recursively parsing it, Ive attached a screen shot of the error if anyone has any idea!! :(

Thanks
Neil

Image
Coordinator
Nov 7, 2013 at 2:08 PM
Hi Neil,

This error means that the parser can't find a matching element according to the rules for D96A.
I would advise you to check your test message against the rules and make sure it is valid.

The rules for edifabric are defined in the definition file generated from the xsd. You can try and pinpoint whether the problem is PIA segment or the previous one - this however involves knowledge of the EDI format.

The bottom line is - either the definition file for D96A is wrong or your sample file does not conform to the definition.

Regards,
Kamen
Nov 7, 2013 at 2:45 PM
Thanks for getting back to me Don,

Yes my knowledge of EDIFACT isnt great, but Edifabric works great for other files from a different source.

I used the M_ORDERS from I got from the website so I think that file is correct, and like i say its working for other test files I have..

It is very strange and frustrating seen as other files work..

Thanks
Neil
Nov 7, 2013 at 5:34 PM
Actually is there way Don to get an instance of the M_ORDERS object from the interchange object

I was expecting to be able to do something like:
                    IEdiParser ediParser = new EdiParser();
                    var interchange = ediParser.ToInterchange<INTERCHANGE>(fs, null);

                    var parsedXml = ediParser.Serialize(interchange);   //gives me the xml fine!


                    interchangeObject= ediParser.Deserialize<INTERCHANGE>(parsedXml);  //gives me back the interchange object

                    M_ORDERS orders = ediParser.ParseOrdersToObject();  //there is no method to do this! :/ am i missing something?
Coordinator
Nov 8, 2013 at 7:57 AM
Hi Neil,

Please have a look at 'Deserializing into messages' discussion below.

Cheers,
Kamen