How can I handle an OnDeserialized event using MessageContract?
Need to do some data verification and transformation after receiving the message (but before executing methods).
For DataContract it was solved by declaration attribute.
But for MessageContract it doesn't work.
Is there any way to do this?
You are better of using WCF extension points instead of serialization. Specifically IOperationInvoker.
EDIT
Example:
Service and message definitions below. Note the new MyValidationBeforeInvokeBehavior attribute.
Hook into wcf extensibility
Custom operation invoker:
The essence is that we never invoke the service call because it will never get there due to the validation error. We can also return what happened to the client.
Validation class and client call (for completes):
client: