I have a xml string in a json data field. I want to extract that value and compare that to the database's value for that field.
I used xsd.exe to generate the class for that xml (saw from here). I am using that class to deserialize the xml response. Then i used the method from here
to deserialize.
I used
`XmlSerializer serializer1 = new XmlSerializer(typeof(class_gen_from_xml))
In the below code, I extracted the xml source from the json response and then did as below:
string xmlSource = "<ResultSet><Result precision=\"address\"> <Latitude>47.643727</Latitude></Result></ResultSet>";
XmlSerializer serializer = new XmlSerializer(typeof(ResultSet));
ResultSet output;
using (StringReader reader = new StringReader(xmlSource))
{
output = (ResultSet)serializer.Deserialize(reader);
}
` And I am getting an Exception and debugging reveals nothing at all. Is there something I am missing in the code ?