问题
We are using distributed architecture for our project. In which UI layer is reside on one server and Business Layer on another server. We are creating Windows service of Business layer. Is it possible to call the windows service from another server UI application. How to do it?
回答1:
There are a couple of options for communicating with a windows service.
- A service bus
- In Proc hosted WebAPI
- Self hosted WCF Service
- SignalR to message between client and server
回答2:
You could create a self hosted wcf service inside of your windows service. Check this similar question and answer for more information: Can I host (self host) a WCF Service in a Windows Service and expose it via http?
来源:https://stackoverflow.com/questions/15247529/asp-net-mvc-4-application-to-call-windows-service