I am currently working on a WebService and struck at how to define properties class for the below use-case:
<Parent>
<Type1>int</Type1>
<Type2>string</Type2>
<Type3>Object</Type3>
<Type3>Object</Type3>
<Type3>Object</Type3>
<Type3>Object</Type3>
</Parent>
My code looks like this:
[XmlRoot]
class Parent
{
[XmlElement]
public int Type1 {get; set;}
[XmlElement]
public string Type2 {get; set;}
[XmlArray]
public List<Type3ListItem> Type3 {get; set;}
}
public class Type3ListItem
{
public string ABC {get; set;}
public string DEF {get; set;}
}
And I would like to Deserialize using System.Xml.Serialization, please advise on how to proceed with this use-case. Also advise if using System.Runtime.Serialization.Formatters.Binary; is better than System.Xml.Serialization for better performance to consume XML of size 50MB(approx).