Menu ▼


Web Serivce vs WCF Service

Difference between webservice and wcf service

Web services are introduced in VS 1.0 and its extension is asmx. WCF(Windows communication foundation, previously code -named "Indigo") is introduced in VS 3.0 and its extension is svc. WCF is a complete replacement for web services it provides lot more features than the web service provides. Below are the few differences between web service and wcf service.

Web Service WCF
Web service support only http protocol. WCF supports http, tcp, named pipes and msmq.
Web service can be hosted only on IIS. WCF service hosting supports IIS, WAS, Windows Service and Self Hosting.
Web service use XMLSerializer (System.XML.Serilization namespace) for data transformation. WCF Service use DataContractSerializer (System.Runtime.Serilization namespace) for data transformation.
Web service gives low performance compared with wcf service. WCF Service are faster than web service performance.
Web service supports one way communication and Request-Response. WCF supports one way communication, Request-Response and Duplex communication.
In web services, unhandled exceptions are returned to clients as SOAP faults. To prevent exposing sensitive data, unhandled exceptions are not returned to client as SOAP faults. By using FaultExcepiton and FaultContract attribute you can return the SOAP faults to clients.
Web service supports Security services. WCF supports security, reliable messaging, transactions, durable messages, service orientation, AJAX and REST services.
Web services use [WebService] and [WebMethod] attributes in implementation. WCF use [ServiceContract] and [OperationContract] attributes in implementation.
Only public fields and properties can be serialized. Classes that implement the IDictionary interface such as Hash table cannot be serialized. Along with public fields and properties Hash table also serializable (Datacontractserializer translate the hash table into XML)





comments powered by Disqus


Search dotnetlearners.com