I\'m trying to use XMLSerializer to generate XML such as the following, where the contents of is an array, but the elements can be of differing t
In your c# class, just make sure you always return an empty array of any possible types that might be returned:
[Serializable]
public class create
{
public create()
{
vendor = new Vendor[0];
customer = new Customer[0];
asset = new Asset[0];
}
Vendor[] vendor { get; set; }
Customer[] customer { get; set; }
Asset[] asset { get; set; }
}
[Serializable]
public class Vendor
{
public string vendorid { get; set; }
public string name { get; set; }
public string vcf_bill_siteid3 { get; set; }
}
[Serializable]
public class Customer
{
public string CUSTOMERID { get; set; }
public string NAME { get; set; }
}
[Serializable]
public class Asset
{
public string createdAt { get; set; }
public string createdBy { get; set; }
public string serial_number { get; set; }
}