WebMethods with Interface/Base Class parameters (.NET)
April 19th, 2005
Not immediately obvious how you can create a web service method that can take/return either an interface pointer or a base class reference.
You need to use the SoapInclude attribute to specify the concrete type(s).
E.g. (assume Cat inherits from Animal)
[WebMethod]
[SoapRPCMethod]
[SoapInclude(typeof(Cat))]
public void processAnimal(Animal animal){}
This MSDN Article on SOAP Attributes has more info if you’re interested









Recent Comments