Problems deserialzing XML document with special characters

N

Norbert Pürringer

Has anyone an advice for me how to deserialize an XML document
containing special characters?

My deserializer looks like following:

public static MyObject Deserialize(XmlDocument xmlRequest)
{
MemoryStream requestStream = new MemoryStream();
xmlRequest.Save(requestStream);
requestStream.Position = 0;
XmlSerializer requestSerializer = new
XmlSerializer(typeof(MyObject));
return
(MyObject)requestSerializer.Deserialize(requestStream);
}


The call of the webservice method and the deserializer:


XmlNode xmlNode = service.GetXmlDocument();
_workflowActions = MyObject.Deserialize(xmlNode);
 
N

Norbert Pürringer

I have forgotten to mention, that the returned XML document (by
calling the web method GetXmlDocument) may have a certain ISO encoding
or UTF-8 encoding. My deserializer should be able to understand each
possible encoding type.

Thank you,
Norbert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top