I have been working with a 3rd party java based REST webservice, that returns an array of xmlNodes.
The xmlNode[] respresent an object and I am trying to work out the b
Maybe this is too late to answer here but it will help others:
Here is the solution you will be able to Deserialize
from the XML node.
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);
XmlNode xmlNode = xmlDoc.SelectSingleNode("//SystemInfo");
XmlSerializer serial = new XmlSerializer(typeof(SystemInfo));
SystemInfo syso =(SystemInfo)serial.Deserialize(new XmlNodeReader(xmlNode));
The first load the XML to XmlDocument Object
and then find the parent node you will wish to deserialize just like I want SystemInfo object node from all the XML document.
Once you find that create an XmlSerializer
object with the specific class type you will wish to.
Now just pass the new XmlNodeReader(xmlNode)
to the Deserialize method, you will get the objects populated in the class object just like I populated syso
object with XML values.
Happy Coding :)