WCF – Windows Communication Foundation
Introduction
- Windows Communication Foundation ( WCF )
- Windows Presentation Foundation ( WPF )
- Windows Workflow Foundation ( WWF )
- Windows Card Space
WCF provides combined features of Web Services , Remoting , MSMQ and COM+ . It is used for building and deploying network distributed services.
WCF provides few important features. So lets discuss few difference and features which make it better than Webservices
Difference between Web Services and WCF
1. Hosting
Web Service can be hosted in IIS whereas WCF can be hosted in IIS , WAS and self hosting
2. Programming
Web Service Class requires [WebService] attribute whereas WCF requires [ServiceContract] attribute
Web Service method requires [WebMethod] attribute whereas WCF methods requires [OperationContract] attribute
3. Serialization
Web Service uses System.Xml.Serialization for serialization whereas WCF uses System.Runtime.Serialization for serialization.
4. Protocols
Web Service supports Security protocol whereas WCF supports Security , Reliable Messaging and Transaction protocols
5. Encoding
Web Service uses XML 1.0 , MTOM , DIME and Custom encoding whereas WCF uses XML 1.0 , MTOM , Binary and Custom encoding.
6. Transport
Web Service uses HTTP and TCP as transport protocols whereas WCF uses HTTP, TCP, Named Pipe , MSMQ and P2P as transport protocols.