I am using VS2010 and .NET 4.0.
I checked here ( Common interfaces that are implemented in the WCF service ), but it differs in that I try to execute an interface that is marked with ServiceContract.
those. in the service, I have interface A (marked as ServiceContract) and extension interface B (also marked as ServiceContract). B is implemented by the WCF service.
The exact extension goes line by line:
public interface A<T> public interface B : A<SpecificType>
("SpecificType" is marked as a DataContract.)
Obviously, B is exposed to the WCF client during proxy generation; however, I need to also open interface A (I am implementing a semi-general pub / subsystem, and the "publisher" should be able to verify / rely on interface A).
The first way I tried to solve this was to create a separate "general" assembly containing an interface, and can be used by both the service and the client; however, this doesn’t work so well, because in the publisher it needs to make sure that instance B has actually expanded with A. This implicit conversion fails, probably because the service reference does not seem completely jive with a “common” assembly.
To get around this, I manually edited the Reference.cs file and it finished the job (I added the definition of interface A and made sure interface B is related to it properly). But this creates a big problem in that every time I update the service link, this code will be destroyed.
Looking at other WCF answers on this site and others, I can’t find the exact answer (maybe I just didn’t go through all of them and their answers).
If someone can point me in the right direction, I would appreciate it.
Thanks.