There are different types of Hosting can be done.
windows process activation services (WAS)
IIS
Self hosting
Hosting in a Windows service
is there advantage of using one over another? which one is preferable?
There are three types of hosting environments for WCF services: IIS, WAS, and self-hosting. The term “self-hosting” refers to any application that provides its own code to initialize the hosting environment. This includes console, Windows Forms, WPF, and managed Windows services.
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 − IIS Hosting − IIS stands for Internet Information Services.
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.
This and this can help. But basically:
1) IIS now using WAS
2) IIS hosting. Pros: generally no hosting code required, easy to maintain, IIS infrastructure (security, sessions, site integration etc). Cons: 'passive' services, require IIS.
3) Self hosting. Pros: easy debugging. Cons: no infrastructure, req. custom hosting code, interactive usage (generally speaking).
4) Hosting in a Windows service. Pros: for 'active', long running services, services infrastructure (start/stop/pause, unattended (non interactive) execution, dependencies, mmc etc), relatively easy to manage. Cons: req. custom hosting code, relatively hard to debug (vs IIS hosting).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With