WCF ASP.NET Web Service
Class Attributes [ServiceContract] [WebService]
Method Attributes [OperactionContract] [WebMethod]
Actual Class Defrived from [ServiceContract] Definition  
Host Hosted in IIS, Windows Service, WAS (Windows Activation Service) Hosted in IIS
Access Protocal HTTP, TCP, MSMQ, P2P, NamedPipes HTTP
Supported Services Security, Transaction, Reliability, REST Support, Interoperability, Durable Massages, Service Orientation, Service Metadata, etc Security Service
Client Generation Using service metadata tool - svcUtil.exe Using command line tool - WSDL.EXE
Exception Handling

Unhandled exceptions are returned to the client as SOAP faults.

Configuration Service is provided to be configured to return an error code to the client for the debuggin purpose.

<serviceBehaviors>

  <behavior name="ServiceBehavior">

    <serviceMetadata httpGetEnabled="true"/>

    <serviceDebug includeExceptionDetailInFaults="true"/>

  </behavior>

</serviceBehaviors>

Unhandled exceptions are returned to the client as SOAP faults.
WSDL Customization WSDL can be customized using ServiceMetadataBehaviour class WSDL can be customized using ServiceDescriptionFormatExtension class
Serialization

System.RunTime.Serialization supported

  • Better performance
  • Hashtable can be serialized
  • Only classes that implement IDictionary can be serialized
  • DataContract and DataMember attribute are to indicate that these can be serialized.

System.XML.Serialization supported

  • Worst performance
  • Hashtable can not be serialized
  • Only calls that implement IEnumarable and ICollection can be serialized
  • Only public fields and properties can be serialized 
Multithreding Can be multithreaded by ServiceBehaviour class Can not be multithreaded
Supported Bindings BasicHttpBinding, WSHttpBinding, WSDualHttpBinding, SOAP and XML