Tuesday, November 27, 2012

Difference between WCF and Web service

Web service is a part of WCF. WCF offers much more flexibility and portability to develop a service when comparing to web service. Still we are having more advantages over Web service. Following points provides detailed difference between them.


Web Service:




  • Hosting -It can be hosted in IIS.

  • Programming -[WebService] attribute has to be added to the class.

  • Model -[WebMethod] attribute represents the method exposed to client.

  • Operation -One-way, Request- Response is the different operations supported in web service.

  • XML -System.Xml.serialization name space is used for serialization.

  • Encoding -XML 1.0, MTOM(Message Transmission Optimization Mechanism), DIME, Custom.

  • Transports -Can be accessed through HTTP, TCP, and Custom.

  • Protocols- Security.


WCF




  • Hosting - It can be hosted in IIS, windows activation service, Self-hosting, Windows service.

  • Programming -[ServiceContraact] attribute has to be added to the class .

  • Model -[OperationContract] attribute represents the method exposed to client .

  • Operation - One-Way, Request-Response, Duplex are different type of operations supported in WCF .

  • XML - System.Runtime.Serialization namespace is used for serialization.

  • Encoding - XML 1.0, MTOM, Binary, Custom.

  • Transports - Can be accessed through HTTP, TCP, Named pipes, MSMQ, P2P and Custom.

  • Protocols- Security, Reliable messaging, Transactions.