Difference between WCF and Web Service

Attributes

WCF has [ServiceContract] attribute attached with the class.
WS has
[WebService] attribute attached with the class.
WCF has
[OperationContract] attribute attached with methods.
WS has
[WebMethod] attribute attached with methods.

Hosting
WCF can be hosted on IIS, WAS, of self-hosting.
WS can be hosted on IIS.

XML
WCF uses using System.Runtime.Serialization; namespace for serialization.
WS uses
using System.Xml.Serialization; namespace for serialization.

Transports
WCF support HTTP, TCP, MSMQ, P2P transport protocols.
WS support Http protocol.

Encoding
WCF supports XML, MTOM (Messaging Transmission Optimization Mechanism), Binary.
WS supports XML, MTOM, DIME (Direct Internet Message Encapsulation).

Security
WCF provides reliable security for messaging and transactions over net.
WS doesn’t provide method level security & message delivery isn’t assured & can be lost without acknowledgement.
Last updated:9/18/2014 1:23:52 PM
Uttam Misra

Uttam Misra

More than 18 years of working experience in IT sector. We are here to serve you best.

1 Comments

Leave Comment