WCF Vs ASMX Web Services

By | June 19, 2012

First of all, it needs to understand that WCF Service provides all the capabilities of .NET web servies and further extends it.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).MCSD Exam: 70-487

ASMX is simple but limited in many ways as compared to WCF.ASMX Web Services Vs WCF

    • ASMX web servicescan be hosted only in IIS whileWCF service has all the following hosting options:
      • IIS
      • WAS (Windows Process Activation Services)
      • Console Application
      • Windows NT Services
      • WCF provided Host
    • ASMX web services support is limited to HTTP while WCF supports HTTP, TCP, MSMQ, NamedPipes.
    • ASMX Security is limited. Normally authentication and authorization is done using IIS and ASP.NET security configuration and transport layer security.For message layer security, WSE can be used.
      WCF provides a consistent security programming model for any protocol and it supports many of the same capabilities as IIS and WS-* security protocols, additionally, it provides support for claim-based authorization that provides finer-grained control over resources than role-based security.WCF security is consistent regardless of the host that is used to implement WCF service.
    • Another major difference is that ASMX web services uses XmlSerializer for serialization while WCF uses DataContractSerializer which is far better in performance than XmlSerializer.
      Key Issues with XmlSerializer in serializing .NET types to xml are:

      • Only public fields or properties of the .NET types can be translated to Xml.
      • Only the classes that implement IEnumerable can be translated.
      • Classes that implement IDictionary, such as Hashtable cannot be serialized.
Hopefully, this WCF Tutorial will be helpful in understanding the difference between WCF and ASP.NET Web Services.
Related WCF Tutorials:

Top 10 Interview Questions and Answers Series:

Category: Uncategorized Tags: , , ,


Imran Abdul Ghani is working as Software Developer(Senior) with extensive knowledge in Web development technologies especially C#, ASP.NET, MVC, WCF, Web API, ADO.NET Entity Framework, jQuery etc. He has several years of experience in designing/developing enterprise level applications. He is Microsoft Certified Solution Developer for .NET (MCSD.NET) since 2005. You can reach his blogging at www.webdevelopmenthelp.net, www.topwcftutorials.net, and www.sharepointfordummies.net.

  • om


  • om

    this is nice

  • http://www.blogger.com/profile/04189701776149476569 Abhi Abhi


  • http://www.blogger.com/profile/09554251642726583292 Ngo Tuan Manh

    Oh! Thanks for your Article

    • http://www.blogger.com/profile/10867674357364468276 Imran Ghani

      Welcome Ngo 🙂

  • Anonymous

    Good Article

  • Anonymous

    Nice Article. Although 1st point is partially correct. ASMX web services can be hosted not only in IIS, but also it can be hosted in windows services. Please refer MSDN and below links for how to host in windows service –

    1) http://msdn.microsoft.com/en-us/library/aa529311.aspx
    2) http://www.csharptutorial.in/2012/01/cnet-difference-between-web-service-and.html

  • Anonymous

    nice article !! it gives more insight on WCF

  • http://www.blogger.com/profile/04879022419007322647 Pankaj


  • http://www.blogger.com/profile/10867674357364468276 imranghani

    In case of DataSet that implements IXmlSerializable interface, its serialized in a special XML format that groups under a common node the schema of the DataSet and its DiffGram representation.

  • Anonymous

    What about XmlSerializer and DataSet which doesn’timplement IEnumerable?

  • http://www.blogger.com/profile/04396571557512025698 Upendra Jena

    those are good differences between WCF and Web services………

  • http://www.blogger.com/profile/05750629044739472705 Gunnas

    Hey Buddy good article. keep it up…….

  • http://www.blogger.com/profile/15152007148367620183 suri

    good.. thanks