WCF - Hosting WCF Service

After creating a WCF service, the next step is to host it so that the client applications can consume it. This is known as WCF service hosting. A WCF service can be hosted by using any of the four ways given below:

在创建wcf服务后,下一个步骤就是托管该服务,确保客户端应用可以使用它。这也被称为wcf服务托管。wcf服务可以使用下面4种中的任一一种方式进行托管

  • IIS Hosting - IIS stands for Internet Information Services. Its working model is similar to that of ASP.NET while hosting a WCF service. The best feature of IIS hosting is that the service activation is processed automatically. IIS hosting also offers process health monitoring, idle shutdown, process recycling, and many more features to facilitate a WCF service hosting.
  • Self-Hosting - When a WCF service is hosted in a managed application, it is known as self-hosting. It requires a developer to write the requisite coding for ServiceHost initialization. In self-hosting, a WCF service can be hosted in a variety of applications like Console application, Windows form, etc.
  • WAS Hosting - Hosting a WCF service in Windows Activation Service (WAS) is most advantageous because of its features such as process recycling, idle time management, common configuration system, and support for HTTP, TCP, etc.
  • Windows Service Hosting - For local system clients, it is best to host WCF service as a window service and this is known as Window Service Hosting. All the versions of Windows support this type of hosting and here, the Service Control Manager can control the process lifecycle of the WCF service.

IIS托管:互联网信息服务,在托管wcf服务的时候,它的工作模式类似于ASP.NET。IIS托管的最好的特性是:服务激活是自动处理的。IIS托管同样提供进程安全监视,空闲挂断,进程复用,以及许多其他的功能来促进wcf服务托管。

自托管:当一个wcf服务托管在一个托管应用上时,被称为自托管。这就要求开发人员为服务托管初始化编写必要的代码。在自托管中,wcf服务可以托管在许多应用上。比如控制台应用,winform应用等。

WAS托管:将wcf服务托管在windows激活服务上是最有利的,因为它包含如下功能:进程复用,空闲时间管理,公共配置系统,并且支持HTTP和TCP等

windows服务托管:对于本地系统客户端而言,将wcf服务作为windows服务来托管是最好的托管方式。所有版本的windows操作系统都支持这种类型的托管,服务控制管理器可以控制wcf服务的进程的生命周期。

时间: 2024-09-29 00:53:36

WCF - Hosting WCF Service的相关文章

WCF: Hosting WCF in Windows Service

1. Create a windows service project 2. Add Reference to the assembly which contains the contract and its implementation. 3. Remove the Service1.cs, add a new Windows Service class and name it to CalculatorWindowsService 4. Override OnStart and OnStop

WCF: Hosting WCF In IIS

1. Create an IIS Application as below 2. In the physical path, there're 2 files and 1 App_Code folder a. App_code contains the WCF Service contract and class implementing the contract b. service.svc contains code hosts the service c. Web.config confi

Hosting Multiple Service Implementations On The Same Port With WCF

Hosting Multiple Service Implementations On The Same Port With WCF Recently I have been playing around with WCF and Visual Studio 2008.  I was building a set of web services.  The project consisted of two difference service interfaces (IServiceA and

WCF - Versus Web Service

There are some major differences that exist between WCF and a Web service which are listed below. 这里总结了WCF和网络服务之间主要的不同之处 Attributes - WCF service is defined by ServiceContract and OperationContract attributes, whereas a web service is defined by WebS

WCF注册Windows Service

WCF注册Windows Service 2014-06-14 返回 在前面创建一个简单的WCF程序,我们把WCF的服务寄宿到了Host这个控制台项目中了.下面将介绍如何把WCF的服务寄宿到Windows服务中: 1. 删除原来Host控制台项目,然后在solution上右键,新建一个WindowService项目.如下图: 2.对MyFirstWindowsService项目添加对Contracts项目.Service项目和System.ServiceModel的引用. 3.将MyFristW

跟我一起学WCF(13)——WCF系列总结

引言 WCF是微软为了实现SOA的框架,它是对微乳之前多种分布式技术的继承和扩展,这些技术包括Enterprise Service..NET Remoting.XML Web Service.MSMQ等.WCF推出的原因在于:微软想将不同的分布式技术整合起来,提供一个统一的编程模型,这样对于开发者来说绝对是好事.在过去的2个月时间内,我陆续写了WCF系列文章,这些文章只是自己这段时间学习WCF内容的一个学习过程和笔记,希望通过这种写博文的方式记录下来和总结.本系列并没有对WCF机制做一个深入解析

WCF - Consuming WCF Service

WCF services allow other applications to access or consume them. A WCF service can be consumed by many ways depending on the hosting type. Here, we are explaining the step-by-step method to consume a WCF service for each of the following popular host

Detecting Client Connection in WCF Long Running Service (Heartbeat Implementation) z

Download source - 45.3 KB Introduction Hello everyone! This is my first blog on WCF and I hope that you like it. Today, I will talk about how to implement heart beat mechanism in WCF, so that whenever client is not alive, our WCF service detects it a

扩展Wcf call security service, 手动添加 Soap Security Head.

有次我们有个项目需要Call 一个 Java 的 web service, Soap包中需要一个 Security Head <soapenv:Header> <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <w