This article describes the basic concepts of Windows Communication Foundation (WCF). In this article I will explain What is WCF, advantages of WCF, What are ABC's of WCF, Features of WCF and difference between Web service and WCF.
What is WCF?
Windows Communication foundation (WCF) is a unified framework which provides secure, reliability, transacted and interoperable distributed application.
There were several ways of technologies present in earlier versions of visual studio.Webservice (ASMX) being used to share information from any platform to another , .NET Remoting being used to communicate between client and server in windows application, Enterprise service(DCOM) being used for any transacted communication or Message queuing used for any Queued model.
WCF brings together the functionality of all those technologies under a unified programming model. This simplifies the experience of developing distributed applications.
Advantages of WCF
- WCF provides an efficient way of communication between applications.
- WCF service can exchange messages using any format (SOAP is default) over any transport protocol (HTTP, TCP/IP, MSMQ, NamedPipes etc).
- WCF can be hosted in many ways in IIS, in Windows service or self hosted.
- WCF has integrated Logging mechanism.
- WCF service provides better reliability and security compared to Web services.
Terms in WCF
A WCF service is exposed to the outside world as a collection of endpoints.
Endpoint: Endpoint is a construct at which messages are sent or received (or both). Endpoint comprises of ABC’s
What are ABC’s of WCF ?
A. Address - Address is a location that defines where messages can be sent
- Binding is a specification of the communication mechanism (a binding) that described how messages should be sent. In my previous article I described about Different types of binding in WCF.
Features of WCF
- Service Orientation
- Multiple Message Patterns
- Service Metadata
- Data Contracts
- Multiple Transports and Encodings
- Reliable and Queued Messages
- Durable Messages
- AJAX and REST Support
Difference Between Web service and WCF
| Web Service
| Can be hosted in IIS
| Can be hosted in IIS,Windows Process activation service (WAS), Self hosting
| Supports only HTTP protocol
| Supports HTTP,TCP, MSMQ, NamedPipes
uses XMLSerilalizer for serialization.
Key Issues with XmlSerializer in serializing .NET types to xml are:
a. Only public fields or properties of the .NET types can be translated to Xml.
b. Only the classes that implement IEnumerable can be translated.
c. Classes that implement IDictionary, such as Hashtable cannot be serialized.
| WCF uses DatacontractSerializer which gives better performance
|ASMX security is Limited.
In WCF, there is no need to make much change in code for implementing the security model and changing the binding. Small changes in the configuration will make your requirements.
I hope this article help you to understand basic concepts of WCF. Please share your valuable feedback on this.