开发者

Can I use WCF for communicating (sending message) between 2 windows service?

Can I use WCF for com开发者_开发百科municating between 2 windows service? If yes, How?


It depends on the type of message you want to transfer. There is a lot of possible solutions:

  • MSMQ messages
  • Duplex contracts
  • Named pipes

Basically you need to setup a WCF service on each windows service. You can use the WCF 4.0 discovery features to dynamically find the each service.


Sure; you'd usually define a service contract (interface) which the two services will use to exchange messages; then one of the windows services would host a WCF service (in this case, where the two services are in the same machine, you'd usually use a local-only binding, such as named pipes). Then the second win service can act as a client for the WCF service on the other windows services. Is there any specific issue you're facing?


Yes, It is possible. You can use ServiceHost class to host a WCF service in a windows service without dependency to IIS.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜