This is a mirror of official site: http://jasper-net.blogspot.com/

Generic WCF Hosting Service

| Thursday, June 17, 2010
The Generic Host Service provides a simple, reusable, and reliable mechanism for hosting WCF services.


The Generic Host Service provides a declarative service registration mechanism using the application configuration file, support for xcopy deployment of new services, support for hosting multiple WCF Services within a single Service Host instance, logging and tracing through Microsoft Logging Application Blocks, and isolation between executing services through App Domains.

2.1 Declarative Service Registration

To register a new WCF service

1.) Copy the dll whcih implements the service as well as any supporting dll's to the directory where the service host is installed.
2.) Add a new service entry to the services node of the hostConfiguration section.
* the name attribute is the name under which you would like the service to be hosted. It will replace the {1} parameter in the hostConfiguration endpoint attribute.
* the assemblyqualifiedname attribute contains the fully qualified assembly name of the binary that implements the sevice.
* the endpoint attribute overrides the the default endpoint provided by the hostConfiguation endpoint attribute.
* the filepath attribute is used to specify a different configuartion file from the current one.
* the enabled attribute allows you to enable or disable the service. The service will not start if the Generic Host is restarted when enabled is set to false
3.) Add the WCF configuration sections as you normally would to configure your endpoint. This is to be done in the current configuration file unless you specified a new one in the filepath attribute of your service.
4.) Start the Generic Host service

<hostConfiguration endpoint="http://{0}:1400/{1}" hostController="Services.WCF.Hosting.HostController, Services.WCF" subscriber="Services.WCF.Hosting.Monitor, Services.WCF.Hosting">
<services>
<service name="Host" assemblyqualifiedname="Services.WCF.Hosting.HostController, Services.WCF" endpoint="http://{0}:1400/{1}" filepath="" enabled="true"></service>
</services>
</hostConfiguration>


2.2 Service isolation

In addition to these features the Generic Service Host provides native and configurable tracing and logging services by leveraging the Microsoft Logging Application Blocks. It also provides a native WCF servicefor managing the WCF Services that are executing within its hosting environment. Through the IHostController contract administrative clients can Start, Stop, Recycle, and Enumerate WCF Services.


2.3 IHostController

Read more: Codeplex

Posted via email from .NET Info

0 comments: