简体   繁体   English

为什么在工作者角色中托管WCF服务

[英]Why Host WCF Service in Worker Role

In the process of building my first AZURE based application using WCF services I have stumbled across a number of examples where people show how one can host a WCF Service inside a Worker Role. 在使用WCF服务构建我的第一个基于AZURE的应用程序的过程中,我偶然发现了一些示例,其中人们展示了如何在Worker角色中托管WCF服务。

Such as in these articles: 比如在这些文章中:

http://www.codeproject.com/Articles/188464/Host-WCF-Services-in-an-Azure-Worker-Role http://code.msdn.microsoft.com/windowsazure/CSAzureWCFServices-20c7d9c5 http://www.codeproject.com/Articles/188464/Host-WCF-Services-in-an-Azure-Worker-Role http://code.msdn.microsoft.com/windowsazure/CSAzureWCFServices-20c7d9c5

Very simple question, can someone please explain what use case would require hosting a WCF service in a worker role? 非常简单的问题,有人可以解释一下在工作者角色中托管WCF服务需要哪些用例? What are the motivation/advantages of doing this? 这样做的动机/优势是什么?

Hosting a WCF service inside of a WebRole implies that it is hosted within IIS. 在WebRole中托管WCF服务意味着它托管在IIS中。 Some folks prefer to not have the footprint of IIS mess with their ServiceHost and host the service directly. 有些人喜欢没有IIS的足迹与他们的ServiceHost混乱并直接托管服务。 They have more control over how the communication with their service is done without IIS in the middle. 他们可以更好地控制如何在没有IIS的情况下完成与其服务的通信。

Also, when shrink-wrapping the packaged solution for customers, it is simpler to create an installer package without trying to rely on IIS infrastructure that customers may or may not have properly deployed/configured. 此外,在为客户收缩打包解决方案时,创建安装程序包而不尝试依赖客户可能已经或可能未正确部署/配置的IIS基础结构更为简单。

HTH HTH

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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