Windows Communication Foundation (WCF)

Windows Communication Foundation (WCF) is a framework for building service-oriented applications by which we can send asynchronous message/data from one service endpoint to another service endpoint.
WCF combines the features of all the distributed technologies, such as:
  1. COM+ Services
  2. .NET Remoting
  3. Web Services

Difference between WCF and Web Services

Web Services WCF
It is available in the namespace "System.Web.Services.WebService" class It is available in the namespace "System.ServiceModel" class
It is only supports IIS hosting It supports various hosting like IIS, Self Hosting (Console hosting), Windows Activation Services and Windows Services
It supports one-way communication and Request-Response It supports one-way and two-way (duplex) communication and Request-Response
Protocol security is supported Protocol security, transaction and reliable message is supported
Web Services are slower than WCF WCF is faster than Web Services
System.Xml.serialization name space is used for serialization System.Runtime.Serialization namespace is used for serialization
Transport protocol like HTTP, TCP and custom is supported Transport protocol like HTTP, TCP, Named Pipes, MSMQ, P2P and custom is supported

Fundamentals of WCF

To understand the architecture of WCF, you should be aware of the fundamentals of WCF. The fundamentals are as follows:
Figure 1: WCF Fundamentals

WCF Architecture

There are four major layers that provide developers with a new service-oriented programming model. The WCF architecture consists of the following layers.
Let us briefly learn about them.
Figure 2: WCF Architecture

Programming Model of WCF

All the communication with a WCF service occurs through the endpoints of the service. An endpoint of a WCF service acts as a gateway for communication with other applications. It is the location where messages are sent or received and contains all the information required for the exchange of a message.
An endpoint is composed of an address, a binding and a contract known as the ABCs of endpoints as shown in the figure.
Figure 3: The ABCs of Endpoints

Advantages of WCF

Summary

Using this article we have learned the basics of WCF, the WCF architecture and the ABCs of endpoints of WCF for beginners. I hope you liked this article. Thanks for reading.
Coming up Next: Creating and Consuming WCF Service
Until then Happy Coding!