I have a .NET web service (using asmx...have not upgraded to WCF yet) that exposes the following:
public class WidgetVersion1 : IWidget {}
public class WidgetVersion2 : IWidget {}
When I attempt to bind to the web service, I get the following serialization error:
Cannot serialize member WidgetVersion1 of type IWidget because it is an interface.
I have tried adding various attributes to the IWidget interface (XmlIgnore
, SoapIgnore
, NonSerialized
), but they are not valid on an interface.
Does anyone know why I am unable to expose the interface? I assume WSDL does not support interfaces, but couldn't .NET get around this by simply not serializing the interface? Are there any ways around this apart from removing the IWidget interface from the WidgetVersion1 and WidgetVersion2 class definitions?