Geeks With Blogs
Rajesh Pillai My experiments with asp.net mvc, jquery, wpf, silverlight, sharepoint, tdd and design patterns.

What is WCF?

Windows Communication Foundation aka WCF is a Microsoft platform for SOA 
(Service Oriented Architecture).  The following are some of the important aspects that WCF allows us to achieve.

  • Its used for building distributed and interoperatble applications.
  • Unifies ASMX, .NET Remoting, Enterprise Services, MSMQ etc.
  • A single programming model for all distributed computing technology.
  • Configuration driven protocol choices, messaging format, reliable transactions etc.
  • Built for service-oriented system design
  • Loosely coupled.  Not bound to a particular protocol, encoding format or hosting environmnet.

Its built on top of .NET and is available with .net framework 3.0 and 3.5.  The overall WCF structure revolves around the following three core contracts.

  • Service Contract     Defines which operations on the service can be invoked by the client.
  • Data Contract           Defines the structure of data included in the payloads of the messages flowing in
    and out of the service.
  • Message Contract     Enables the developer to control the headers that appear in the messages and how
    the messages are structured.
     

Real World Consideration

To design real world service contracts, we have leave our object oriented thinking behind.  We have to think in
terms of messages.  Messages are flowing in and out of the system.  For instance, you might have a
SignatureScanningService that would recieve a SignatureDocuments in a message payload, which would in turn
trigger the processing of signature.  This is typically used in banks wherein the clients signature needs to
be captured and processed.  You can also consider the example of LoanProcessingApplication.  The processing
may be a long running task, in that case some kind of acknowledgement should be return frrm the service to the
client.  We have to move towards more document centric thinking.

WCF and Web Services Standards

The WCF contrcts directly maps to the following web services in the following way.

  • Service contracts map to WSDL (Web Service Description Language)
  • Data contracts map to XSD (xTensibile Schema Definition)
  • Message contracts map to SOAP (Simple Object Access Protocol) [The abbreviation is no longer important
    as SOAP is more that a simple object access).

SOA (Service Oriented Architecture)

The following points briefly highlights the essence of SOA.

  • A service is a program that performs some task and the client can interact with the service using well-defined
    contracts.
  • A service-oriented applciation consists of loosely coupled services that communicates through messages
    and contracts.  They directly don't instantiate the service but interacts through messages.

Principles

  • Boundaries are explicit
    - Services communicate by sending messages across their boundary.
    - All communication occur through messages.
     
  • Services are autonomous
    - Services are build, managed and version independently.
    - Services can be changed without affecting clients as long as clients can continue sending and receiving
      the same messages.
     
  • Services share contracts and schema
    - Contracts describe the messages services can send and receive.
    - Schemas define how the client and service construct the messages they exchange.
     
  • Compatibility is policy based
    - Services can define the policiies under which the clients can communicate with them.

In the next post we will quickly have a look at the building blocks of WCF and continue our discussion on
contracts, services, data and messages...

Cheers till then !!

 

Posted on Sunday, December 20, 2009 12:15 PM wcf , SOA | Back to top


Comments on this post: WCF 1 - Introduction

# re: WCF 1 - Introduction
Requesting Gravatar...
i need some what more introdution about wcf.
Left by nagi on Jan 20, 2010 5:15 PM

Your comment:
 (will show your gravatar)


Copyright © Rajesh Pillai | Powered by: GeeksWithBlogs.net