Difference between Web Service and WCF

 

Web Services

WCF

 Definition Web Service’ is a method of communicating over the WWW between two or more devices. WCF : ‘Windows Communication Foundation’ is a framework for building the Service Oriented Aplications.
Release Web Services was released with ASP.Net 2.0. WCF was released with .NET Framework 3.0.
 Hosting ASP.Net web services are hosted in Internet Information Services  : IIS. WCF is hosted in IIS ,WAS : Windows Activation Services, Windows service and also supports ‘Self-hosting’.
File Extension
Web Services in Asp.net have “.asmx” file extension. WCF have  “.svc” file extension.
 Protocol Supports ASP.Net web services accessed through HTTP : Hyper Text Transfer Protocol. WCF can be accessed through HTTP, TCP, MSMQ : Message Queuing and Point to Point (P2P).
 Services Provides Security services. Not only supports security but also AJAX, REST, Reliable messaging, transactions
Multi-Threading Web Services does not support multi-threading. WCF supports multi-threading using “ServiceBehavior class”.
 Serialization For data transformation  web services use ‘XML serializer’ and namespace “System.XML.Serialization For data transformation WCF uses ‘DataContractSerializer ‘ and namespace ‘System.RunTime.Serialization’.
 Messaging Web services in Asp.Net use only SOAP : Simple Object Access Protocol for messaging. WCF uses SOAP (Default) but also support other protocols for messaging.
 Performance Web services are slower than WCF.  WCF is faster in compare to Web services.
 Limited serialization Using web-services only public fields / Properties can be serialized and it can not serialize Hash table. WCF can serialize public / private fields as well as Hash Table.
Attributes Web service use [WebService] and [WebMethod] attributes. WCF uses [ServiceContraact] and [OperationContract] attributes.