The most important part to understand from my opinion when working with WCF is the transaction part. WCF supports two types of transactions: shared transactions and transacted messaging. WCF supports two transaction protocols:
Transaction Process (Client & Server Side) 1-Client Side
As well as specifying transaction requirements, the client can control the isolation level and timeout for the transaction by using a TransactionOptions object:
2-Server Side The ServiceBehavior attribute enables you to configure the service as a whole for transaction time-outs, isolation level, and whether transactions complete when a session closes. The OperationBehavior attribute helps you to control whether a transaction is required for an operation, and whether transactions complete if no exception is thrown. WCF can use Microsoft Message Queuing, or MSMQ, to pass messages between clients and services. Queuing can improve application resilience and scalability. Reliable Sessions in WCF: A reliable session provides session-based delivery for WCF messages, regardless of the number or type of transport intermediaries between two endpoints. Reliable sessions handle lost or duplicated messages. Messages are delivered exactly once, and can optionally be delivered in order. If a message cannot be delivered, the sender is informed. They are enabled by default for theWsDualHttp, NetNamedPipeandMsmqIntegrationbindings, and can be enabled for theNetTcp, WsHttpandWsHttpFederationbindings.
Finally, I’d like to thank all of you for your Attention and hope that you’ve learned something new from these WCF 11 parts that I’ve written :) Mohamed Adel Mahmoud. Microsoft Intern – Senior Microsoft Student Partner – Microsoft Egypt. | ||||||||
For More Info Please Visit: WCF Resources Page |
Saturday, October 16, 2010
Transactions in WCF: (WCF Part 11)
Security Features of WCF: (WCF Part 10)
WCF provides comprehensive security features in three main areas: transfer security, authentication and authorization of clients, and auditing.
Security Modes of WCF: WCF can provide authentication, privacy, and integrity for messages by using two mechanisms:
You can specify the security for a binding by setting its SecurityMode property. By default, the BasicHttpBinding has no security configured. Other HTTP bindings use WS-Security, and TCP and Named Pipe bindings use Windows security. You can use the .NET PrincipalPermission attribute to restrict access to an operation based on name, role, or authentication status.
| ||
For More Info Please Visit: WCF Resources Page |
Guidelines for Configuring the Transport Layer: (WCF Part 9)
NATs and Firewalls: Streaming Message Transfer: Unidirectional or bidirectional streaming is enabled through the TransferMode property of the transport binding element. Note that there are some restrictions on the use of streaming, especially when using certain WCF features, such as reliable messaging, transactions, and SOAP security, which may require buffering. Transport Quotas: WCF supports two main types of quota: timeouts to guard against denial of service attacks and allocation limits to guard against excessive memory use. | ||
For More Info Please Visit: WCF Resources Page |
Binding in WCF: (WCF Part 8)
Choosing a Predefined Binding in WCF: Defining a Custom Binding in WCF: A binding is made up of a collection of binding elements, each of which describes some feature of the endpoint's communication. It is important to know about transports, encoding, and other elements when you create a custom binding, because you must choose which elements to put into the stack. A binding must specify at least a transport and an encoder. For example, the NetTcpBinding combines the TCP transport with a binary encoder. You may wish to create a new binding to accommodate a new transport or encoding. WCF provides three predefined transports:
In addition to a transport, a binding requires a message encoder to serialize a WCF message into bytes. WCF has three encoders to handle text, binary, and MTOM data. The text encoder supports plain old XML (POX) as well as SOAP encoding. If your encoding requirement is not handled by these three encoders, you can write your own custom encoder. | ||
For More Info Please Visit: WCF Resources Page |
Asynchronous Invocation in WCF (WCF Part 7)
object can be any object you want to pass to the callback function and in WCF it is usually a reference to the proxy:
The callback function is executed when the service operation completes, and the callback function calls the matching End method:
WCF Service Behavior: it's very necessary to demonstrate how the clients will connect with the WCF Services (e.g. How many service instances will be used to serve the clients, operation counts, Error handling, Security, such as impersonation, authorization, Metadata etc) Behaviors may be code-only, or may also use configuration settings. e.g.
OR you can use Throttling: Throttling allows you to set limits on access to a service, such as the number of connections or pending calls. You configure throttling in the configuration file:
Developers can also retrieve the throttling settings at runtime, and modify them before opening the service. Developers can create custom behaviors by using IServiceBehavior and IEndpointBehavior. | ||||||||||||||
For More Info Please Visit: WCF Resources Page |