WCF Services

Home / WCF Services

WCF SERVICES

Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application.

WCF had two main goals

  • Implement the WS-* specification as closely as possible, in a way that provides the best interoperability with other WS-* implementations,
  • Unify the programing model regardless of the transport, the serialization format … The vision was that your code would be the same whether you used named pipes, tcp… and regardless of the security model…

This makes WCF one of the best ways to build applications where strict compliance with WS-* protocols is required.

 

The complexity of WCF comes from:

 

  • Merging many very different transport technologies in one framework (Tcp, Udp, Http, Duplex Http, WS http, MSMQ, WebHttp, WebSockets, Azure Relays).
  • Solving lots technical problems in one framework (serialization, one way, two ways, single instance, sessions, async, duplex, streaming, queueing, security, reliability, distributed transactions.
  • Fine tuning and flexibility, allowing the user to have control on almost all aspects of its behavior under all conditions.
  • Implementing the standards, and the standards themselves are -as usual- BAD and couldn’t foresee the future.
  • WCF is a framework that allows you to create frameworks. with its low level details and control and all the techs merged in it you can build platforms and frameworks using it. Azure services depend a lot on WCF.
Net MVC Developer 1 - WCF Services

Why Choose WCF ?

WCF has been around since .NET 3 and is now a fairly mature solution. It provides a unified way of dealing with different communication solutions where previously a developer would have needed to write code differently based on whether they used Web Services, MSMQ, Remoting, WSE etc. WCF does support more varied and complex security option when you need them, especially if you are using wsHttpBinding rather than basicHttpBinding. This is because wsHttpBinding has full support for the WS-Security W3C standard.

 

In general you will want to use WebAPI for most situations and use WCF only for niche situations where WebAPI does not offer sufficient security options. The main reason you might use WCF for security would be if you are constrained to use the HTTP (unencrypted) as a transport protocol

In what scenarios must WCF be used

  • A secure service to process business transactions.
  • A chat service that allows two people to communicate or exchange data in real time.
  • Exposing a workflow implemented using Windows Workflow Foundation as a WCF service.
  • A Silverlight application to poll a service for the latest data feeds.
  • A service that supplies current data to others, such as a traffic report or other monitoring service.
  • A dashboard application that polls one or more services for data and presents it in a logical presentation.

Features of WCF :

  • Service Orientation
  • Interoperability
  • Multiple Message Patterns
  • Service Metadata
  • Data Contracts
  • AJAX and REST Support
  • Security
  • Multiple Transports and Encodings
  • Reliable and Queued Messages
  • Durable Messages
  • Transactions
  • Extensibility