WCF Basics

 

WCF is windows communication foundation is a structure that is used for supporting communication between two or more servers irrespective of their platform or technology.

 

We know that there was a concept called web services prior to WCF. Why we require WCF and the main difference/advantages of WCF over web services is explained in the below paragraph.

 

               Web Services

 

              WCF

Communication happens over HTTP protocol only

Communication happens over HTTP/TCP/IP/MSMQ protocols

Configured over simplex and request response

Configured over simplex, request response or even full duplex.

Can be hosted inside a webserver only

Can be hosted in many ways IIS, webserver, windows server or self-hosted

Can be used to communicate between applications using same protocols.

Can be used to communicate between  different kinds of applications using different protocols

 

ABC’s of WCF

The main concept/pillars behind a WCF   service is its ABC’s better known as Address, Binding and Contract.

 

  • Address refers to the address of the service or where the service is located

 

  • Binding refers to how to communicate or which protocol is used to communicate

 

  • Contract refers to the functionalities or services that the service provides to the client. There are various types of Contracts .The basic ones required for a service to function is Service Contract, Operation Contract and the data Contract