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

Hosting a WCF REST Service with WebServiceHost

| Monday, August 16, 2010
WebServiceHost  factory helps us to host a WCF REST Service in  managed application.  This class is derived from ServiceHost class and automatically enables webHttpBinding  and webHttpBehavior on the service End points.

In this article, I will explain

  1. What is WebServiceHost Factory class?
  2. What is its function?
  3. Where to use it?
  4. One sample on hosting WCF REST Service using WebServiceHost.
What is WebServiceHost factory?
  1. This is useful to host WCF REST End points.
  2. This is derived from ServiceHost.
  3. WebServiceHost has some extra functionality.
  4. WebServiceHost works exactly the same way ServiceHost works.

WebServiceHost factory perform following special task
It disables meta data
It disables WSDL
It disables end point
It prevents meta data publishing
Autometically create End Point
It autometically creates the end point for all contracts using webHttpBinding
No need to call AddServiceEndPoint
Autometically add WebHttpBehaviour
It adds behavior to all end point adding behavior ensures URI+Verb routing will work for all incoming requests

Posted via email from .NET Info

0 comments: