I am writing a .NET webservice (VB.NET). One of the methods DisplayChild() returns an object of type Child. Child is defined:
<Serializable()> _
Public Class Child
Inherits BaseClass
Property NotInInheritedProperties() as Object
...
End Property
End Class
and the BaseClass looks something like:
<Serializable()> _
Public MustInherit Class BaseClass
Property BaseProperty() as Object
...
End Property
End Class
However, in the SOAP definition that shows the return from the DisplayChild() the only property shown in the output is the NotInInheritedProperties property. My question then, is how do I get the properties in the BaseClass to show up in the SOAP document? Originally I didn’t have the Serializable attribute on the BaseClass thinking that was the problem. However, even after changing that it still didn’t work.
Even if BaseProperty isn’t on displayed on the SOAP Definition when you view the service via your web browser, it looks like it’s still part of the WSDL. If you review the WSDL (YourService.asmx?WSDL, or that link that says “Service Description” on YourService.asmx), you should see the inheritance between BaseClass and Child, something like:
If you have a consumer of your web service that can’t see that property, then it may be an issue with their specific implementation (I’ve worked with some “web service enabled” enterprise apps that absolutely choked on web services that return complex types)