WCF服务通过在Azure中工作者角色HTTP? [英] WCF service over HTTP in an Azure worker role?

查看:224
本文介绍了WCF服务通过在Azure中工作者角色HTTP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我明白,你是能够打开80端口上的Azure工作者角色,公开运行的WCF服务。我,但是,有麻烦未来与它更有意义,做这种方式,而不是在一个Web角色运行方案。任何想法?

I understand that you are able to open port 80 on an Azure worker role and run a WCF service publicly. I am, however, having trouble coming up with a scenario where it makes more sense to do it this way as opposed to running in a web role. Any ideas?

推荐答案

在一个工人的作用将主要是自承载承载的WCF服务:)从你的OnStart(,你会创建一个新的ServiceHost(),然后去那里。

A WCF service hosted in a worker role will essentially be self-hosted: From your OnStart(), you'd create a new ServiceHost() and go from there.

在Web角色中承载的WCF服务将利用IIS来承载服务,作为S​​VC,以IIS的性能计数器,缓存,自动激活,进程回收等优势。

A WCF service hosted in a web role would be taking advantage of IIS to host the service, as an svc, taking advantage of IIS performance counters, caching, automatic activation, process recycling, etc.

更有趣:在您代管您的网站Web角色,你仍然可以运行一个自承载WCF服务的方式作为辅助角色一样。你只需要创建(在部署或内部终点,只有你的Windows Azure网站/工作者角色实例可以使用)其他端口上的另一个输入端点。

Even more interesting: In a web role where you host your website, you could still run a self-hosted WCF service the same way as in a worker role. You'll just need to create another input endpoint on some other port (or an internal endpoint, usable by only your Windows Azure web/worker role instances in your deployment).

和另一个场景:通过运行一个自托管服务,你不局限于.NET - 火起来,知道如何去倾听端口的任何可执行文件。这开辟了机会举办一个Java的服务主机,蟒蛇等。

And yet another scenario: By running a self-hosted service, you're not limited to .net - fire up any executable that knows how to listen to a port. This opens up opportunities to host a Java service host, python, etc.

这篇关于WCF服务通过在Azure中工作者角色HTTP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆