Exposing an Interface to a client in a WCF Server.


  • I am writing a WCF Service.

    I am having a Products class which derives from a List collection. Now there are other classes which are similar to this class. So i am having an interface as IBase and all my classes implement this interface. When i implemented my service, i am able to access all my classes, but my IBase interface is not visible from client side. I am not able to mark interface as DataMember. Can anyone help me how to expose my interface to the client? IBase interface is not a service contract. It is just an interface which all my entity objects implement.


    Thanks and Regards,


    Monday, July 14, 2008 1:05 AM


  • KnownType attribute is a way to ensure that the type data for teh contract is added to the wsdl metadata.  This only works for classes it will not work for an interface.  An interface cant store data and is not univerally understood by all languages out there so its not really exposable over wcf.


    Wednesday, July 16, 2008 5:38 PM

All replies