Page 1 of 1

SoapServer Derived Type Response Issue

Posted: Tue Jul 21, 2009 3:25 pm
by mortifer
1. I'm using the core SoapServer object to run a web service for a C# .Net client.

2. I have defined three complexTypes in the WSDL: TypeA, TypeB, and TypeC.

3. TypeB and TypeC extend TypeA.

4. The client understands these extensions because I am able to cast locally created instances of TypeB/C to TypeA and the reverse where proper.

5. Individual web service operations that return TypeB and TypeC work as expected.

6. I have defined a single web service operation that is defined in the WSDL to return a complexType TypeA whose handling code is designed to return an instance of either derived type depending on the parameter values.

7. Attempts by the client to cast the result to the appropriate derived type throw runtime exceptions complaining that the client is unable to perform the cast.

Are there any commonly known gotchas to returning a derived complexType as an instance of the parent?

Thanks for reading.