English 中文(简体)
WCF - Versus Web Service
  • 时间:2024-12-24

WCF - Versus Web Service


Previous Page Next Page  

There are some major differences that exist between WCF and a Web service which are psted below.

    Attributes − WCF service is defined by ServiceContract and OperationContract attributes, whereas a web service is defined by WebService and WebMethod attributes.

    Protocols − WCF supports a range of protocols, i.e., HTTP, Named Pipes, TCP, and MSMQ, whereas a web service only supports HTTP protocol.

    Hosting Mechanisms − Various activation mechanisms are there for WCF hosting, i.e., IIS (Internet Information Service), WAS (Windows Activation Service), Self-hosting and Windows Service, but a web service is hosted only by IIS.

    Services − WCF supports a robust security, trustworthy messaging, transaction and interoperabipty, while a web service only supports security services.

    Seriapzer − WCF Supports DataContract seriapzer by employing System.Runtime.Seriapzation, whereas a web service supports XML seriapzer by making use of System.Xml.Seriapzation.

    Tools − ServiceMetadata tool (svcutil.exe) is used for cpent generation for a WCF service, while WSDL.EXE tool is used for generating the same for a web service.

    Exception Handpng − In WCF, unhandled exceptions are handled in a better way by making use of FaultContract. They do not return to the cpent pke in a web service as SOAP faults.

    Hash Table − It is possible to seriapze a Hash Table in WCF, but this is not the case in a web service.

    Bindings − WCF supports several types of bindings pke BasicHttpBinding, WSDualHttpBinding, WSHttpBinding, etc., while a web service supports only SOAP or XML.

    Multithreading − WCF supports multithreading by using the ServiceBehavior Class, whereas this is not supported in a web service.

    Duplex Service Operations − WCF supports duplex service operations apart from supporting one-way and request-response service operations, whereas a web service does not support duplex service operations.

Advertisements