September 23rd, 2003, 06:22 AM
C# Soap Xml and control characters
I'm serialising an object using the SoapFormatter to produce a soap/xml document. The object contains a data string which is obtained from third party software so we have no control over the format of this string. The string often contains at any index the control character Ox19. This doesn't present any problem during serialisation and the resulting soap/xml document can be viewed using IE, XMLSpy, etc.
However, when I try to deserialise the soap/xml it fails while trying to parse the file as Ox19 is an invalid character in XML Version 1.0.
I've tried posting on the XML forum and there doesn't appear to be a solution from that angle.
I cannot do anything like replacing the character because it can appear at any point in the string, at multiple locations, etc and ALL valid characters can be used within the string as well.
Is there a way to, say, set the SoapFormatter to ignore and pass over this error?
ANY suggestions or possibly botches to get around this problem would be most greatfully received!