Browsing All Posts filed under »WCF Extensions«

Choosing the right extensibility point

June 3, 2011 by


WCF pipeline architecture is very extendable, allowing the developer to hook-in, in various locations and implement a custom logic as needed. As there are so many extendability points and some might seem to overlap. It is sometimes confusing or overwhelming to decide which extensibility method to use and where exactly to hook it. So how […]

IDispatchMessageInspector –How to change the message on the server side?

May 4, 2011 by


IDispatchMessageInspector allows to validate and modify the Message on the server side (similar to IClientMessageInspector, which is added on the client). It’s interface allows you to interfere with the request Message before it arrives to the server, and with the response Message before it is sent to the client. The IDispatchMessageInspector interface contains the following […]

IEndpointBehavior–How to add behavior on a specific endpoint?

April 30, 2011 by


IEndpointBehavior, as its name implies, allows you to add your custom behaviors on the service endpoints both on the client, and on the server. The IEndpointBehavior interface is very similar to the IOperationBehavior interface which was described in the previous post

IClientMessageInspector – How to inspect and modify the message?

March 29, 2011 by


IClientMessageInspector allows to inspect or modify SOAP messages on the client side. Here are some examples of usage for this extensibility point: Message Validation – Ensure the message is compliant with a certain schema Validate its content or headers Logging or Tracing Manipulating the Message (For example: manipulate its headers) Note: Parameters validation is done […]

IDispatchMessageFormatter – How to customize reply Messages on the server side?

March 3, 2011 by


The IDispatchMessageFormatter extensibility hook is very similar to the client’s IClientMessageFormatter which was described in the previous post iclientmessageformatter. On the server side,  WCF converts requests into Message objects which are later on converted to a strongly typed operation parameters. The IDispatchMessageFormatter allows us to interfere in the later conversion (Message to operation parameters). It […]

IClientMessageFormatter– How to customize Messages on the client side

February 15, 2011 by


WCF allows client side developers to perform communication operations by using strongly typed operations. Internally, WCF translates these strongly typed operations into a generic Message class, which can be used by the WCF client runtime. When sending a message, WCF takes the parameters passed as the client operation parameters and “serializes” them into a Message […]

ICallContextInitializer–How to capture the thread’s state?

January 14, 2011 by


The ICallContextInitializer located in System.ServiceModel.Dispatcher namespace is used to initialize and restore the thread context (thread local storage, CallContext, etc.) before and after the operation is invoked on the server side. By default, WCF will not do it for you unless you explicitly add this behavior.