Using code like:
...
EdiMessage ediMessage = (EdiMessage)instance;
using (FileStream ediStream = File.OpenWrite(file))
{
using (EdifactWriter writer = new EdifactWriter(ediStream))
{
writer.Write(ediMessage);
}
}
I receive an error message 'No interchange was started.'
Stack trace below the writer.Write call (last public version of Edifabric):
at EdiFabric.Framework.Writers.EdiWriter`2.Write(EdiMessage message)
It concerns a D96A INVOIC object with BGM, some FTX and a UNH. The object class is . And the exception is raised by EdiWriter on the call writer.Write
.
The ediMessage
contents seem valid. According to Edifabric documentation it should add the default EDIFACT separators automatically:
If not explicitly specified the writer will use the default separators per standard:
What did I forget to setup?