I can inspect WCF messsages on both Client side and server side using IClientMessageInspector, IDispatchMessageInspector respectively. But in a Duplex comunications it is not clear how to do it in a callback from server to client (Nor much documentation on that topic).
Any ideas about how to implement this feature?
Finally I get the solution.
In a Duplex comunication scenario when a callback is made the server becomes the client and vice versa.
So on server side when implementing IServiceBehavior inject the message inspector using the CallbackClientRuntime property of the DispatchRuntime foreach EndpointDispatcher.
On client side when implementing IEndpointBehavior inject the message inspector using the CallbackDispatchRuntime.
Then apply the extension as always.
In my case I created a class like the following pseudo code
then I applied this attribute to service implementation for the server side inspection and added a behaviorExtensions inside the app.config to setup the endpoint for message inspection on client side.