Question - What is the difference between ASMX web services and WCF?
Answer -
The main difference between WCF and ASMX web service is that ASMX is designed to send and receive messages using SOAP over HTTP only while WCF facilitates you to send and receive messages using any format over any transport protocol.
ASMX web services can be hosted only in IIS while WCF service has all the following hosting options:
o IIS
o WAS (Windows Process Activation Services)
o Console Application
o Windows NT Services
o WCF provided Host
o ASMX web services support is limited to HTTP while WCF supports HTTP, TCP, MSMQ, NamedPipes.
o ASMX Security is limited. Normally authentication and authorization are done using IIS and ASP.NET security configuration and transport layer security. For message layer security, WSE can be used.
o 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 claims-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.
o Another major difference is that ASMX web services use XmlSerializer for serialization while WCF uses DataContractSerializer which is far better in performance than XmlSerializer.