简体   繁体   中英

Can multiple WCF services communicate with each other?

I'm just beginning WCF and so I don't understand exactly how the abstraction works. Can I write a WCF service and install the same thing on multiple machines, and have them communicate via some ID? I'm looking at sending/receiving commands, and continuous real-time data being sent between devices.

Any service you write can be installed on any number of machines - no problem there.

Any machine or code you run on those machines can also act as a client at the same time, calling other services, yes, absolutely, that's totally possible.

You need to define your service contract as an interface and in that service contract you describe the operations (service methods). Once that service is deployed, anyone can act as a client to that service and send it messages.

And of course, you can have an app (ASP.NET, Winforms whatever) that is both simultaneously - it offers services, but also acts as a client to other services.

Hope that helps a bit!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM