Header Ads

Webservice vs WCF

Difference between Web Service and WCF

1. Hosting Environment:
Web Service can be hosted only in IIS while WCF service can be self hosted, in IIS or in a separate server (WAS).

2. Programming Attributes:
Web Service uses [WebService] attribute to make the class as service. So this attribute is mandatory for a class to behave as service.
In WCF Service, [ServiceContract] attribute is mandatory to be added has to be added to the class.

3. Contracts Model:
In Web Service, [WebMethod] attribute is mandatory to expose the method to the clients.
In WCF Service, OperationContract] attribute is mandatory to be added with the operation to be exposed to the client.

4. Types of Operation:
Web Service Supports One-way and Request- Response operations for the messages.
WCF Service Supports One-Way, Request-Response and Duplex operations for the messages.

5. Serialization:- 
Web Service uses System.Xml.Serialization namespace for the serialization of the data.
WCF Services uses System.Runtime.Serialization namespace for making the serialized data.

6. Encoding Supports:
 Web Service supports XML 1.0, MTOM(Message Transmission Optimization Mechanism), DIME and Custom Encoding while WCF Service supports XML 1.0, MTOM, Binary and Custom encoding.

7. Transports: 
In Web Services, data can be accessed through HTTP, TCP and Custom ways while in WCF Services, accessing of the data can be done via HTTP, TCP, Named pipes, MSMQ,P2P and Custom.

8. Security: 
In Web Services, Security can be implemented through HTTPS(Client Certificates) while in WCF Services, Security implementation can be done using the Message level and Transport level security

No comments:

Powered by Blogger.