Difference between WCF and Web Service
In this blog I am listing few differences between WCF and Web Service. A lot from us gets confused which is the best out these two to use. Please have a look on the below table and find yourself what to choose and why.
WebService
|
WCF
| |
· WebService and WebMethod attributes are used for defining web service.
|
· ServiceContract and OperationContract attributes are used for defining WCF service.
| |
· Support security but is less secure as compared to WCF.
|
· Supports security, reliable messaging, transaction and AJAX and REST supports.
| |
· Supports XML serializer by using System.Xml.Serialization.
|
· Supports DataContract serializer by using System.Runtime.Serialization.
| |
· Supports One-Way and Request-Response service operations.
|
· Supports One-Way, Request-Response and Duplex service operations.
| |
· Web Services are slower than WCF
|
· WCF are faster than Web Services.
| |
· Hash Table cannot be serialized. It can serializes only those collections which implement IEnumerable and ICollection.
|
· Hash Table can be serialized.
| |
· Unhandled Exceptions returns to the client as SOAP faults.
|
· Unhandled Exceptions does not return to the client as SOAP faults. WCF supports better exception handling by using FaultContract.
| |
· Doesn’t support multi-threading.
|
· Supports multi-threading by using ServiceBehaviour class.
| |
· Supports XML and MTOM (Message Transmission Optimization Mechanism) message encoding.
|
· Supports XML, MTOM, Binary message encoding.
| |
· Web Services are hosted in IIS by pointing the ASMX file to the virtual directory.
|
|
Comments
Post a comment