Web Services: ASP.NET Web Services vs WCF Services

Description Article
Summary

Basic differences between old Web Services and WCF Services.

Description

 

ASP.NET Web Service WCF Service Comments
Definition
Web server components developed for building applications that send and receive messages Components developed for building applications to send and receive messing by using many formats and conveyed by using any transport protocol.
Message Format
Supports only the SOAP 11.1 and 1.2 formats Supports web services format SOAP 1.1, SOAP 1.2, WS-*, ReST (POX and JSON response formats) and easily adapted to use new ones SOAP is the message default format for WCF
Transport Protocol
 Invoked only through HTTP protocol as POST requests Supports HTTP (POST requests for SOAP and POTS/GET/PUT/DEL for ReST) , TCP and other network protocols.
Hosting
 Hosted only on IIS Hosted in IIS, a Windows Service, a Winforms application or a console application
.asmx file required .svc file required when hosted on IIS WCF limitation removable through routing or URL redirection
Message Serialization
Serialization performed by XmlSerializer class Serialization performed by DataContractSerializer class
Supports only serialization of collection classes that implement IEnumerable and ICollection interfaces Supports serialization of collection classes that implement IDictionary interface
Serialization does not support versioning Serialization supports versioning
Development
  Not applicable WCF services developed based on contracts, interface, operations, and data contracts.
Configuration
 No specific configuration required Complex configuration on 3.5 or simplified-configuration on 4.x Configuration on web.config or dinamically trhough code
Metadata
Automatically generate metadata to describe Web services in the WSDL language WCF can be configured to automatically generate metadata to describe applications built using the technology in WSDL language
How to do it
WSDL can not be generated for ReST services since it is returned within a SOAP message
  Not applicable WCF can be configured to automatically generate metadata to describe applications built using the WS-MetadataExchange (WS-MEX or MEX) protocol
How to do it
MEX returns a SOAP message over any transport protocol with all the parts (while the WSDL URLs use HTTP GET requests and require sending several requests to get all the parts).MEX can not be configured for ReST services since it is returned within a SOAP message
 Not applicable An help page at the relative  “/help” URI can be configured to provides a list of operations that the service exposes.
How to do it
For each of theses operations, there is a description field, which is just the absolute URI for the operation by default.