Pro WCF: Practical Microsoft SOA Implementation
by Chris Peiris, Dennis Mulder, Shawn Cicoria, Amit Bahree, Nishith Pathak
Self-Hosting Your Service
The most flexible and easiest way to host WCF services is by self-hosting. To be able to self-host your services, you have to meet two requirements. First, you need the WCF runtime; second, you need a managed .NET application in which you can host ServiceHost. It is your own responsibility to write the code that starts and stops the host.
The following are the advantages of self-hosting:
Is easy to use
With only a few lines of code you have your service running.
Is flexible
You can easily control the lifetime of your services through the Open() and Close() methods of ServiceHost<T>.
Is easy to debug
Debugging WCF services that are hosted in a self-hosted environment provides a familiar way of debugging, without having ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access