Difference between Web Services and WCF

Key Difference: A web service can be described as a system of software components that are available over internet. It comprises of protocols and standards that are used for exchanging data. Thus, it assists in interoperable exchange of data between machines over a network. WCF stands for Windows Communication Foundation. It can be described as a framework for building service-oriented applications. It provides a runtime environment for the services. WCF "web services" are part of a much broader spectrum than in comparison to web services.

A web service has been defined in several ways. According to W3C Web Services Architecture Requirements, October 2002, a web service is a “Software application identified by a URI, whose interfaces and bindings are capable of being defined, described, and discovered as XML artifacts”. In simple words, it can be described as a system of software components that are available over the internet. It comprises of protocols and standards that are used for exchanging data. Thus, it assists in interoperable exchange of data between machines over a network. 

WCF stands for Windows Communication Foundation. Earlier it was known as “Indigo”. It can be described as a framework for building service-oriented applications. It provides a runtime environment for the services. It has been included in the .NET framework in order to achieve a unified programming model. This model speeds up the process of development of service-oriented applications that interact over the web. They are created and deployed as Windows Service, Web Service, Windows Process Activation Service (WAS). Features of WCF include –

  • Service Orientation – The emphasis is on the creation of service oriented applications.
  • Interoperability – Latest industry standards are implemented for web service interoperability.
  • Multiple Message patterns – Numerous patterns are available for exchanging the messages.
  • Service Metadata – Formats like WSDL and XML schema are used in order to support publishing service metadata.
  • Security – Security features like encryption and authentication are available.
  • Durable Message – A message of a durable pattern is always saved in a database.
  • AJAX and REST support
  • Extensibility – It offers extensibility in various areas like extending bindings, channel layer, serviceHost, etc.

In order to compare web services with WCF services, the difference between web service in ASP.net and WCF service can be determined.

Comparison between Web Services and WCF in ASP.net:

 

Web Services

WCF

Definition

A web service can be described as a system of software components that are available over internet. It comprises of protocols and standards that are used for exchanging data. Thus, it assists in interoperable exchange of data between machines over a network.

WCF stands for Windows Communication Foundation. It can be described as a framework for building service-oriented applications. It provides a runtime environment for the services.

 

Accessibility

Rigid - Web Services can be accessed only over HTTP

Flexible 

File Format/Extension

.asmx as a file extension

.svc as a file extension

Serialization

System.Xml.serialization name space is used for serialization

System.Runtime.Serialization namespace is used for serialization

Unhandled exceptions

Returned to the client as SOAP faults

 

Not returned to clients as SOAP faults

Client development

Done by using a command-line tool WSDL.EXE

Done by using the ServiceMetadatatool

Encoding

XML1.0, MTOM (Message Transmission Optimization Mechanism), DIME (Direct Internet Message Encapsulation)

XML1.0, MTOM, Binary

Service Development

It has been mandatory to add the WebService attribute to a class, and the WebMethodAttribute to any of that class’s methods that are to be operations of the service.

Endpoints need to be defined (one or more)

Message Representation

Customization of the headers of the SOAP messages can be done.

Attributes, MessageContractAttribute, MessageHeaderAttribute, and MessageBodyMemberAttribute are provided to explain the structure of the SOAP messages.

Image Courtesy: tutorials.jenkov.com, codeproject.com

Most Searched in Sports Most Searched Non-Alcoholic Drinks
Most Searched in Education and References Most Searched in Environment
Cigarettes vs Cigar
Synchronous Motor vs Induction Motor
iOS 8 vs iOS 9
Point vs Line vs Plane

Add new comment

Plain text

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.