If I have a web service method like
[WebMethod]
[XmlInclude(typeof(SportsCar)), XmlInclude(typeof(FamilyCar))]
public Car[] GetCars()
{
Car[] cars = new Car[2];
cars[0] = new FamilyCar();
cars[1] = new SportsCar();
return cars;
}
If I want to add a new car type to my service, I will have to add a new XmlInclude attribute to the web method. Unfortunately, customers (AFAIK) will now need to update the web service link, rebuild and redeploy. Otherwise, they will receive an XML document generation error.
What strategies exist to solve this problem?
Thanks.
source
share