WCF Vs ASMX Web Services – Easy WCF
Skip to content

WCF Vs ASMX Web Services

Simple and basic difference is that ASMX web service is designed to send and receive messages using SOAP over HTTP only. While WCF service can exchange messages using any format (SOAP is default) over any transport protocol (HTTP, TCP/IP, MSMQ, NamedPipes etc)

WCF vs ASMX service

 

WCF Service ASMX Web Services
WCF is defined by service contract and operation contract ASMX web service is defined by webservice and web methods
WCF supports range of protocol like HTTP,TCP etc ASMX Web service only supports HTTP
WCF can be hosted in IIS and WAS ASMX webservice is only hosted in IIS
ServiceMetadata tool (svcutil.exe) is used for WSDL generation for a WCF service WSDL.exe is used to generate WSDL in ASMX Web Service
WCF supports data contract serializer using System.Runtime.Serialization ASMX Web service supports XML serializer using System.Xml.Serialization
In WCF, Unhandled exceptions are handled using Fault Contract In ASMX Web service, Unhandled exceptions are handled using Soap faults
WCF supports BasicHttpBinding, WSDualHttpBinding, WSHttpBinding etc ASMX Web service supports only SOAP and XML
WCF supports multithreading by using the ServiceBehavior Class web service does not support.
The WCF provides extensible objects for state management. Extensible objects are objects that implement IExtensibleObject<T>. ASMX Web service manages session by using the Session property of the HttpContext
Authentication can be managed by WCF itself, which support Windows authentication among various other options. The other options that are built-in include username tokens, X.509 certificates, SAML tokens, and CardSpace card, but custom authentication mechanisms can also be defined IIS provides facilities for controlling access to applications by which you can select either anonymous access or a variety of modes of authentication: Windows Authentication, Digest Authentication, Basic Authentication, and .NET Passport Authentication
The WCF configuration system provides its own identity element for designating a particular user to impersonate. Also, WCF clients and services can be independently configured for impersonation ASP.NET provides an identity element by which an ASP.NET Web service can be made to impersonate a particular user or whichever user’s credentials are provided with the current request
The same can be done for WCF applications hosted within IIS. However, WCF applications hosted outside of IIS can also be configured to use a secure transport protocol. More important, WCF applications can also be configured to secure the messages before they are transported, using the WS-Security protocol The confidentiality of messages exchanged with ASP.NET Web services can be ensured at the transport level by configuring the application within IIS to use the Secure Hypertext Transfer Protocol (HTTPS).

© 2015, admin. All rights reserved.

3 thoughts on “WCF Vs ASMX Web Services

  1. Pingback: WCF Interview questions (Part -1 ) | EasyWCF

  2. Pingback: Top 10 WCF Interview Questions | EasyWCF

  3. Pingback: WCF Interview questions (Part – 3) | Easy WCF

Leave a Reply

Your email address will not be published. Required fields are marked *