I have to use XMLSerializer
to serialize an object as a soap encoded xml.
I've found the following article : https://learn.microsoft.com/en-us/dotnet/standard/serialization/how-to-serialize-an-object-as-a-soap-encoded-xml-stream
But an error occurs once i call the serialize method...
The error message is:
Token StartElement in state Epilog would result in an invalid XML document.
Do you have any idea how i can fix it ?
XmlTypeMapping myTypeMapping = new
SoapReflectionImporter().ImportTypeMapping(typeof(typeOfMyObject));
XmlSerializer ser = new XmlSerializer(myTypeMapping);
MemoryStream Stream = new MemoryStream;
ser.Serialize(Stream,myObject);