difference between webservice and wcf

Introduction:

Asp.net povides various options for creating services under .NET Framework. Before WCF, ASP.NET Web Services are used to ceate service in .NET Framework. Now WCF is the latest programming model for building and developing service-oriented application.

WCF allows applications to communicate with each other in distributed environment. WCF is a set of technologies that covers ASMX web services, Web Services Enhancements (WSE), .NET Remoting and MSMQ. 

WCF
Web Service
It can be hosted in IIS, windows activation service, Self-hosting, Windows service
It can be hosted in IIS
[ServiceContraact] attribute has to be added to the class
[WebService] attribute has to be added to the class
[OperationContract] attribute represents the method exposed to client
[WebMethod] attribute represents the method exposed to client
One-Way, Request-Response, Duplex are different type of operations supported in WCF
One-way, Request- Response are the different operations supported in web service
System.Runtime.Serialization namespace is used for serialization
System.Xml.serialization name space is used for serialization
XML 1.0, MTOM, Binary, Custom
XML 1.0, MTOM(Message Transmission Optimization Mechanism), DIME, Custom
Can be accessed through HTTP, TCP, Named pipes, MSMQ,P2P, Custom
Can be accessed through HTTP, TCP, Custom
Supports security, reliable messaging, transaction and AJAX and REST supports.
Support security but is less secure as compared to WCF.
WCF are faster than Web Services.
Web Services are slower than WCF
Hash Table can be serialized.
Hash Table cannot be serialized. It can serializes only those collections which implement IEnumerable and ICollection.
Unhandled Exceptions does not return to the client as SOAP faults. WCF supports better exception handling by using FaultContract.
Unhandled Exceptions returns to the client as SOAP faults.
Supports multi-threading by using ServiceBehaviour class.
Doesn’t support multi-threading.

Most features of WCF:
  • Service Orientation
  • Interoperability
  • Multiple Message Patterns
  • Service Metadata
  • Data Contracts
  • Security
  • Multiple Transports and Encodings
  • Reliable and Queued Messages
  • Durable Messages
  • Transactions
  • AJAX and REST Support
  • Extensibility

No comments:

Post a Comment