-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing UNZ segment terminator #142
Comments
Hi @GVG and thanks for your interest in the library. This definitely should not be happening. So it is a potential bug in the serializer. |
I've taken a look at the code and as far as I understand I've also tried following variations of public class Interchange
{
public InterchangeHeader Header { get; set; }
}
public class Interchange
{
public InterchangeTrailer Trailer { get; set; }
}
public class Interchange
{
[EdiValue("9(6)", Path = "UNZ/0", Mandatory = true)]
public int ControlCount { get; set; }
[EdiValue("X(4)", Path = "UNZ/1", Mandatory = true)]
public string ControlReference { get; set; }
} PS version is 1.9.5 from NuGet |
Hi @GVG , I finally figured it out. There was a bug with the EdiSerializer class when using Expect a v1.9.6 to land on nuget withing the day |
Thank you very much! |
Hi @cleftheris using (var ms = new MemoryStream())
using (var tw = new StreamWriter(ms))
{
new EdiSerializer().Serialize(tw, EdiGrammar.NewEdiFact(), GetInterchange());
var d = ms.ToArray();
} Also I was told that last segment terminator must be followed by CRLF otherwise it's not a valid document. Do you know anything about this? |
Hi,
regarding the last CRLF it seems I have made a regression bug with the last change I made. I did this on purpose because I have not found any documentation stating that it is required when ending the document (especially if
I will give this another look. |
One more question: Before you changed to the overloads not requiring a EdiWriter where you disposing of the It is by design that these overloads of Serialize do not call I am thinking of running close on every serialize call just to be sure the developer does the right thing and I will see how it goes. |
Thank you. EdiTextWriter was disposed by using block in initial variant, but this happens after I read and return the document. Current variant is fine for me. Regarding CRLF I couldn't find any reliable or official sources, but my partner and some docs state that segment terminator symbol followed by CRLF in UNA is treated as whole segment terminator. Thus multi-line document must end with |
Hi! I'm serializing EDIFACT document and having issue with missing segment terminator of last (UNZ) segment. This is what I get:
There is no
'
terminator in the end of the document.Is this correct behavior?
Code:
The text was updated successfully, but these errors were encountered: