Web Service Vs WCF


Introduction

ASP.NET Web services were developed for building applications that send and receive messages by using the Simple Object Access Protocol (SOAP) over HTTP. The structure of the messages can be defined using an XML Schema, and a tool is provided to facilitate serializing the messages to and from .NET Framework objects. The technology can automatically generate metadata to describe Web services in the Web Services Description Language (WSDL), and a second tool is provided for generating clients for Web services from the WSDL.

WCF is for enabling .NET Framework applications to exchange messages with other software entities. SOAP is used by default, but the messages can be in any format, and conveyed by using any transport protocol. The structure of the messages can be defined using an XML Schema, and there are various options for serializing the messages to and from .NET Framework objects. WCF can automatically generate metadata to describe applications built using the technology in WSDL, and it also provides a tool for generating clients for those applications from the WSDL.

Protocol Support

WCF Supports following protocol: HTTP, TCP, Named Pipes, MSMQ, Custom, UDP.

Web Service Support only HTTP Protocol.

Hosting Support

Web Service can be hosted only with Http Runtime on IIS. WCF component can be hosted in any kind of environment in .NET 3.0, such as a console application, Windows application, or IIS.

WCF services are known as ‘services’ as opposed to web services because you can host services without a web server.

Self-hosting the services gives you the flexibility to use transports other than HTTP.

Backwards Compatibility

The purpose of WCF is to provide a unified programming model for distributed applications.

WCF takes all the capabilities of the existing technology stacks while not relying upon any of them.

Applications built with these earlier technologies will continue to work unchanged on systems with WCF installed.

Existing applications are able to upgrade with WCF

Integration

WCF can use WS-* or HTTP bindings to communicate with ASMX pages

Advantage of WCF or Limitations of ASMX

An ASMX page doesn’t tell you how to deliver it over the transports and to use a specific type of security. This is something that WCF enhances quite significantly.

ASMX has a tight coupling with the HTTP runtime and the dependence on IIS to host it. WCF can be hosted by any Windows process that is able to host the .NET Framework 3.0.

ASMX service is instantiated on a per-call basis, while WCF gives you flexibility by providing various instancing options such as Singleton, private session, per call.

ASMX provides the way for interoperability but it does not provide or guarantee end-to-end security or reliable communication.

Reference : http://msdn.microsoft.com/en-us/library/aa702755.aspx

Advertisements

One thought on “Web Service Vs WCF

  1. Hi
    thanks!

    If you could include the following for comparison it will be of more help,
    1. Security. (encryption, certificates..)
    2. State or Transaction. (can pass transaction, etc…)
    3. Dual or Multipoint. (two way one way..)
    4. Dependency. (Client, Server any other software required..etc like this)
    5. Host

    Sahridhayan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s