Reputation: 93
Ok guys. This is more of a "Can this be done?" question as opposed to "How do you do this?"
I have a WCF project with multiple services and everything is lining up fine. Two of them will be wrapped in Windows Service installers that will go on two different servers. Is it possible to call a method in one service from the other service if they are on two separate machines? Or do I have to use the Callback scenario I have seen used before?
I appreciate any advice or ideas. Thanks.
Upvotes: 0
Views: 103
Reputation: 3970
This depends on the binding you are using and any firewall / network route rules on and between the two machines.
If you are using a namedPipeBinding, the answer is no because named pipes are bound to a machine. However, if you are using any of the other bindings like webHttp, basicHttp, etc you should be ok. The beauty of WCF is that you should be able to just spin up another service endpoint using a different binding if necessary -- so even if you are using named pipes, it should be pretty straight forward to swap that out with a different binding.
A WCF service can certainly be a client to another WCF service.
Upvotes: 4