Communication between 2 WCF services

How to communicate between two WCF services hosted on two different machines.

+1


source to share


2 answers


Easy! With WCF!



Add a service link for each, pointing to the other, and you're done.

+1


source


The question is a bit vague because it really depends on what you are looking for for communication between the two machines and what you are using.

The first way I interpret this question is that service A needs to contact service B and vice versa. The easiest way is for Service A to be the client of service B and Service B to be the client of service A. When the host starts each service, it also opens the client proxy for communication. This will work regardless of the binding used.



The second way I interpret this question is that Service A should be a client of service B, but allow service B to call back to service A. Simply changing the service contract to include callback contracts should be sufficient for this. Of course this won't work for all bindings, especially if you are using message queues.

0


source







All Articles