An Introduction to WCF

WCF

WCF stands for Windows Communication Foundation. It was introduced in .NET 3.0 framework. Its code name is Indigo. WCF is a combination of Web Service, .NET Remoting , MSMQ and COM. In WCF we create applications that use services. So basically by WCF we create services that are used in the applications.“*.svc” is the file extension of the WCF service.

WCF is interoperable. It can be used in any platform making it platform independent. There is built in support for logging that can be enabled or disabled using configuration. For other technologies manual code needs to be written to log.

We can describe WCF in the following manner:

WCF= Web service + Remoting + MSMQ + COM

We can host WCF on TCP,IPC as well which is not possible with WebService because Web Service runs only on HTTP/HTTPS using SOAP. Following transport schemes are supported by WCF:

  • HTTP/HTTPS
  • TCP/IP
  • MSMQ
  • Service Bus

Hosting WCF Services

WCF Service is to be hosted in the host process. A single host process can host multiple WCF Services. We can host WCF Services in many ways:

  • IIS Hosting: Like Web Services WCF service can be hosted in IIS. The contents of the file can be published and put in the virtual directory of IIS.

  • Self Hosting: In self hosting a developer hosts a wcf service in different applications such as a console application, web based application, WPF application etc.

  • Windows Activation Service(WAS): WAS is a general purpose hosting engine. It hosts service and any transport can be used such as TCP,IPC or MSMQ.