In this article, we will discuss on WCF architecture.
WCF has a layered architecture.
It has application layer,Contracts, messaging and activation and hosting layer.
Contracts and Descriptions:
- Contracts defines the various service operations.
- The data exchanged by a service with Client is defined by a data contract. Both the client and the service has to be in agreement with the data contract.
- The message parameters are defined by XML Schema definition language (XSD) documents. The message contract defines message parts using SOAP protocols. A data contract is controlled by message contract.
- The service contract specifies the actual method signatures of the service.
- Policies and bindings defines the conditions required to communicate with a service.
- The service runtime layer contains the runtime behaviors of actual operation of the service.
- Throttling controls how many messages are processed.
- An error behavior specifies what occurs when an internal error occurs on the service,
- Metadata behavior governs how and whether metadata is made available to the outside world.
- Instance behavior specifies how many instances of the service can be run
- Transaction behavior enables the rollback of transacted operations if a failure occurs.
- Dispatch behavior is the control of how a message is processed by the WCF infrastructure.
- Extensibility enables customization of runtime processes.
- Parameter filtering enables preset actions to occur based on filters acting on message headers.
Reference books, you may like:Programming WCF Services: Design and Build Maintainable Service-Oriented Systems
WCF Multi-Layer Services Development with Entity Framework, 4th Edition
Learning WCF: A Hands-on Guide
- The messaging layer is composed of channels.
- A channel is a component that processes a message in some way . A set of channels is also known as a channel stack. Channels operate on messages and message headers.
- There are two types of channels: transport channels and protocol channels.
- Transport channels read and write messages from the network (or some other communication point with the outside world).
- Examples of transports are HTTP, named pipes, TCP, and MSMQ. Examples of encodings are XML and optimized binary.
- Protocol channels implement message processing protocols, often by reading or writing additional headers to the message.
- Examples of such protocols include WS-Security and WS-Reliability.
- The messaging layer supports the possible formats and exchange patterns of the data.
- WS-Security is an implementation of the WS-Security specification enabling security at the message layer.
- The WS-Reliable Messaging channel enables the guarantee of message delivery.
- The encoders present a variety of encodings that can be used to suit the needs of the message.
- The HTTP channel specifies that the HyperText Transport Protocol is used for message delivery.
- The TCP channel similarly specifies the TCP protocol. The Transaction Flow channel governs transacted message patterns.
- The Named Pipe channel enables interprocess communication.
- The MSMQ channel enables interoperation with MSMQ applications.
Hosting and Activation:
- A service must be run in an executable. This is known as a self-hosted service.
- Services can also be hosted, or run in an executable managed by an external agent, such as IIS or Windows Activation Service (WAS).
- WAS enables WCF applications to be activated automatically when deployed on a computer running WAS.
- Services can also be manually run as executables (.exe files).
- A service can also be run automatically as a Windows service.
- COM+ components can also be hosted as WCF services
© 2015, admin. All rights reserved.