Friday, September 14, 2012

What is the difference between WCF Service and Web Service?

WCF is a replacement for all earlier web service technologies from Microsoft. It also does a lot more than what is traditionally considered as "web services". Web service is a part of WCF where as WCF is combination of Webservice+MSMQ+Remoting+COM

Here are few important differences between WCF and Web service

  1. WCF is a programming model and API. "WCF Service" implies an app that is built using that programming model and API.
  2. WCF comes with .Net frame work 3.0/3.5. To use in 2.0 frame work we need to install MS add in component.
  3. Web service can be hosted on IIS only where as WCF can be hosted on IIS, Self hosting, Windows service and Windows activation service. Since WCF can be hosted in different applications it is flexible. 
  4. You can build a Web service using WCF, but you can also build a Web service using other APIs or "stacks". Like PHP or Java, for example.
  5. WebService and WebMethod are used in web services where as in WCF - Service contracts, Operation contacts, Message contacts, Data contacts and Fault contacts are used in the service. 
  6. WebService can be accessed over HTTP, TCP, Custom where as WCF can be accessed over HTTP, TCP, Named pipes, MSMQ , Custom and P2P.  
  7. In Webservice unhandled exceptions are returned to clients where as in WCF a configuration settins is provided for these faults.  
  8. Webservice use System.Xml.serialization to translate data where as WCF uses System.Runtime.Serialization name-space.  
  9. "Basically, WCF is a service layer that allows you to build applications that can communicate using a variety of communication mechanisms. With it, you can communicate using Peer to Peer, Named Pipes, Web Services and so on.

No comments:

Post a Comment