I need to implement custom caching of client proxy of wcf service. I've implemented the IOperationBehavior interface. On server-side we can set OperationDescription.Invoke property in ApplyDispatchBehavior method and implement IOperationInvoker interface to control operation execution. On client-side we can't do it.
In client-side we can use the IClientMessageInspector, IParameterInspector, IClientMessageFormatter interfaces to control message flow. The main problem is that I have to store in cache only the service answer without information about message format. When I restore values from cache I should create message again like in case of service response. I cannot break following internal message processing. So on that moment I lose necessary information about message such as encoding, content-type(json, xml) in case of RESTful services. Final result - WCF cannot process such message. I want to disable message processing if cached value exists. How I can do it?