Introduction: Hosting of WCF Services.

In this, we describe various types of hosting in WCF Services and what are the limitations of Hosting a WCF Service.

Types of Hosting in WCF Services:

  1. IIS Hosting
  2. Self Hosting

IIS Hosting:

Disadvantage of IIS Hosting:

  1. Only HTTP Protocol used.
  2. All the sevice will run on the same port.

Self Hosting:

Code:

Sub Main()
' Create and open the host.
Using myServiceHost As New _
ServiceHost(GetType(WcfMathService.MyCalc))
myServiceHost.Open()

' Just to keep the host alive.
Console.WriteLine("Hit Enter to shut down host")
Console.ReadLine()
End Using
End
Sub

Limitations of Hosting of WCF Service:

  1. WCF service cannot exist in Void.
  2. Every WCF service must be hosted in a Windows process called the Host process.