Inherited class not published through a WebService's WSDL
Posted on 2007-08-02
I have a web-service with a web-method that returns a (simple) object of type TestBase, and when I create a TestBase object and return it everything works OK,
if I create a TestChild class that inherits from TestBase, it is not exposed in the WebService's WSDL (since the WebMethod is of return-type TestBase), and the object returned from the method of type TestBase is not recoginzed, I get an InvalidOperationException telling serializer does not know how to serialize this object,
If I create another (web)method of type TestChild, then the first method (that is defined returning a TestBase) works well, since the TestChild's class interface is published through the WSDL, and is also shown in Object Browser when updating the web-reference.
So, I think what I need is simply a way of exposing TestChild's interface through the TestService's WSDL without having to explicitly create a TestChild web-method.