Web App与Windows Service中的WCF托管 [英] WCF hosting in Web App vs Windows Service

查看:106
本文介绍了Web App与Windows Service中的WCF托管的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我已经搜索和阅读了几天关于此主题的内容,但实际上找不到我的问题的简单答案.当然,这意味着可能没有一个,但嘿,这就是希望!

我只想知道在Asp.Net Web应用程序或Windows服务中托管WCF服务的优点/缺点和不同之处

在我的解决方案中,我既有Windows服务又有Web应用程序,我只是想让它们互相交谈.

Hello,

I''ve been search and reading on this topic for a few days now but can''t really find a simple answer to my question. Which of course means there probably isn''t one, but hey, here''s to hoping!

I would just like to know the advantages/disadvantages and differences of hosting a WCF service in an Asp.Net Web Application or a Windows Service

In my solution I have both a windows service and a Web App, and I''m just trying to get them to talk to eachother.

推荐答案

您好,

Windows Communication Foundation(WCF)是用于构建面向服务的应用程序的框架.使用WCF,您可以将数据作为异步消息从一个服务端点发送到另一个服务端点.服务端点可以是IIS托管的连续可用服务的一部分,也可以是应用程序中托管的服务.
端点可以是从服务端点请求数据的服务的客户端.消息可以像以XML发送的单个字符或单词一样简单,也可以像二进制数据流一样复杂.

Windows服务:一个程序的技术实现,其中
旨在连续在后台运行.示例:SQL Server服务以及您在Windows XP或Vista的Services.msc控制台下看到的所有其他服务.

我什么时候应该创建Window服务?
当您要创建Windows服务时,可以使用它.服务必须在没有UI的情况下在后台运行.基本上与WCF无关.它可以是一般的ftp服务或http服务,MSMQ服务.
转到开始->运行并键入Services.msc.您将看到操作系统和其他软件在其中安装和运行的服务.

何时应该创建新的WCF服务应用程序?
就像您可以将WCF服务托管在Windows服务中一样,其中服务不断在某个端口上进行监听.您可以在同一行上在IIS中托管服务.为此,您实际上使用了该选项.打开此模板,然后运行F5.您将看到默认情况下该服务将使用ASP.net开发服务器(请参见Windows托盘)并为您托管该服务.

在什么情况下必须使用WCF:

1)处理业务交易的安全服务.
2)一种向其他人提供当前数据的服务,例如交通报告或其他监视服务.
3)允许两个人实时通信或交换数据的聊天服务.
4)仪表板应用程序,它轮询一个或多个服务以获取数据并将其以逻辑表示形式呈现.
5)公开使用Windows Workflow Foundation作为WCF服务实现的工作流.
6)一个Silverlight应用程序,用于轮询服务以获取最新的数据供稿.

有关更多信息,请通过以下链接:
WCF和Web服务之间有什么区别? [ ^ ]
WCF与Windows服务之间的区别 [ ^ ]
Hello,

Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application.
An endpoint can be a client of a service that requests data from a service endpoint. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data.

Windows Service: Technical implementation of a program which
is intended to run in the background continuously. Example: SQL Server Service and all other services that you would see under Services.msc console on windows xp or vista.

When should I go to create Window service ?
You would use this when you want to create windows service. The sevice which has to run in the background without UI. Has basically got nothing to do with WCF. It can be a genenral ftp service or http service, MSMQ service.
Goto Start-> Run and type Services.msc. You will see services that the OS and other software installs and runs there.

When should I go to create a new WCF service application?
Like you can host your WCF services in windows service, where the services are constantly listening at some port. You can on the same lines host the services in IIS. For this you actually use this Option. Open this template and give it a run- F5. You will see the service by default will use ASP.net development server (see your windows tray) and host this service for you.

In what scenarios must WCF be used:

1) A secure service to process business transactions.
2) A service that supplies current data to others, such as a traffic report or other monitoring service.
3) A chat service that allows two people to communicate or exchange data in real time.
4) A dashboard application that polls one or more services for data and presents it in a logical presentation.
5) Exposing a workflow implemented using Windows Workflow Foundation as a WCF service.
6) A Silverlight application to poll a service for the latest data feeds.

For more information please go through following links:
What''s the Difference between WCF and Web Services?[^]
Difference Between WCF and Windows Service[^]


这篇关于Web App与Windows Service中的WCF托管的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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