Windows Communication Foundation - SPLessons
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

WCF Architecture

WCF Atrchitecure

Simple Architecture of WCF

shape Architecture

Contracts

shape Description

Contracts will provide functionality to the members of the service like using data contract will take data fields and properties to be implemented. Using operation contracts one can develop the functions. By using message contracts, the message format to be implemented can be developed etc.
  • Service Contract - Service contract provides information to the client. When creating a WCF Service the first task is to define a Service Contract. A service can have more than one service contract, but it should have at least one service contract.
  • Data Contract - Data contract is a formal agreement between the client and the service. The data exchanged by a service is defined by a data contract.
  • Message Contract - A message contract describes the format of the message. Data contract controlled by message contract. Message contract declares whether the message element should go in headers or body, and what kind of security level should be applied to the message.
  • Fault Contract -A fault contract can be associated with the service operation to denote the errors that can be to the client. A single operation can have zero or more fault contract associated with it.
  • Policy and Binding - Here some conditions has to be followed for communication with service. Those conditions client needs to follow this contract, the conditions are defined by policy and binding.

    Service Runtime

    shape Description

    The service run-time specifies the various behaviors that occur during run-time of service. Behavior and Service runtime contain metadata whether the service is implementing any transaction process etc. A service run-time has many types of behaviors.
    • Throttling Behavior - Here throttling behavior manages the number of messages while receiving and sending.
    • Error Behavior - If there is any internal service error occur then it show the description of the error result.
    • Metadata Behavior - It will describe about the metadata information.
    • Instance Behavior - It will show the number of instances that the client needs to create.
    • Transaction Behavior - Enables a change in transaction state in case of any failure.
    Instead of above-mentioned behaviors there are three other behaviors like Dispatch Behavior, Concurrency Behavior, and Parameter Filtering.

    Messaging

    shape Description

    The message content to be communicated between two endpoints is known as a messaging.A set of channels from a stack and the two major types of channels are:
    • Transport Channel - Transport channels are used for sending and receiving messages using transport protocols like HTTP, TCP, Named Pipes, MSMQ, and Peer-to-peer. Transport channels present at the bottom of a stack.
    • Protocol Channels - Protocol channels are also layered channels. The purpose of the protocol channels is modifying a message.

    Activation and Hosting

    shape Description

    This layer will specify the host and consumption. WCF Service supports hosting mechanism like messaged hosting, windows hosting, self-hosting, and was hosting. This is done by various Techniques discussed below in brief.
    • ISS - IIS (Internet Information Server) is a group of Internet servers including a Web or Hypertext Transfer Protocol server and a File Transfer Protocol serverIt is not required to have the host code for activating the service code. Because, the service code gets activated automatically.
    • Windows Activation Service (WAS) - The WAS hosting is the real new feature because it provides a concept that extends the ASP.NET HTTP hosting concept (ASMX Web Services). WAS builds on the existing IIS 6.0 but is more powerful because it provides support for other protocols besides HTTP, such as TCP and Named Pipes.
    • Self-Hosting - WCF provides the user to host the service in any application. For example, console application, Windows form. This Technique offers amazing.
    • Windows Service - This Hosting option consists registering the WCF Service with runtime Windows Service. So that WCF Service lifetime is controlled by the operating system.]