Hi,
The following code worked for me with your xml:
string xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><ArrayOfResultInfo xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://tempuri.org/\"><ResultInfo><PartNumber>KRPA - 4007 </PartNumber><Manufacturer> test </Manufacturer></ResultInfo></ArrayOfResultInfo>";
var serializer = new XmlSerializer(typeof(ArrayOfResultInfo));
ArrayOfResultInfo result;
using (TextReader reader = new StringReader(xml))
{
result = (ArrayOfResultInfo)serializer.Deserialize(reader);
}
Console.WriteLine(result.ResultInfo.Manufacturer);
Console.WriteLine(result.ResultInfo.PartNumber);
Console.ReadLine();
The classes for xml are as follows:
[XmlRoot(ElementName = "ResultInfo", Namespace = "http://tempuri.org/")]
public class ResultInfo
{
[XmlElement(ElementName = "PartNumber", Namespace = "http://tempuri.org/")]
public string PartNumber { get; set; }
[XmlElement(ElementName = "Manufacturer", Namespace = "http://tempuri.org/")]
public string Manufacturer { get; set; }
}
[XmlRoot(ElementName = "ArrayOfResultInfo", Namespace = "http://tempuri.org/")]
public class ArrayOfResultInfo
{
[XmlElement(ElementName = "ResultInfo", Namespace = "http://tempuri.org/")]
public ResultInfo ResultInfo { get; set; }
[XmlAttribute(AttributeName = "xsd", Namespace = "http://www.w3.org/2000/xmlns/")]
public string Xsd { get; set; }
[XmlAttribute(AttributeName = "xsi", Namespace = "http://www.w3.org/2000/xmlns/")]
public string Xsi { get; set; }
[XmlAttribute(AttributeName = "xmlns")]
public string Xmlns { get; set; }
}
Hope this helps !