Adding a service reference to a web service (all this WCF) in Visual Studio produces some generated code, including cloud-side
I understand why this interface is generated: You can consume a third party service and do not have access to the actual interface.
But I do, and both not assignments are consistent, even if the transparent proxy actually implements the interface, which I want to insert.
I can use reflection, but it is ugly. Is there any way to overcome this type of wrong type protection and to inject metadata, so I can use an interface with the class?
My specific problem starts in a complex way with the ideal single client, which directly uses some derivatives of the base class and remotely uses others through service references. In order to inform the base class for each server, it is necessary to keep a reference in order to subscribe to the customer in a collection, and the problem was different due to the proxy use
out of these answers No one solves my specific problem, yet every one answer was educative and helpful. I got my own solution (use dual binding) but I have never Would have thought In that you have not significantly improved my understanding of the whole business.
Three excellent answers to choose just one? I choose first, because it resolves the problem directly I thought was.
When you add a service reference, go to "advanced" and make sure that "referenced assemblies Reuse types "and that the assembly with your interface definition is selected. You can do this with an existing service reference, by right clicking on it and going to "Configure".
Comments
Post a Comment