Introduction

Windows Communication Foundation (WCF) is an SDK for developing and deploying services on Windows.

WCF provides a runtime environment for services, enabling you to expose CLR types as services, and to consume other services as CLR types.

Service: the functionality exposed to the world

Client: consuming the functionality from the service.

Main Components

  1. Endpoint
  2. Hosting environment
  3. Service class

The Endpoint in WCF Is ABC

WCF supports following transport schemas

Contracts in WCF

Hosting of WCF

  1. IIS
  2. Self Hosting
  3. WAS (Windows Activation Service)

Implementation

STEPS FOR WCF IMPLEMENTATION

Server Side

In main program

In VS2008 CMD

  1. Svcutill.exe/language:cs/out:<filename.cs>/config http://……
  2. Svcutill.exe/language:cs/out:client.cs>/config http://……
Add that file to client solution.

Client side

Create an end point by using tat obj:

  1. <servicename> obj=new <servicename>();
  2. Console.WriteLine(“{0}”,obj.Add(10,5));