I send a message from my client (implements IClientMessageInspector) using BeforeSendRequest() and receive the reply from the endpoint at AfterReceiveReply().
My question is what is the most effective way to "validate" the reply that I receive is in relation to the request I sent?
I found some article about using the correlationstate, but the examples were all too vauge.
Any help is greatly appreciated.
As far as I know, we could use the
Correlationstate
parameter to maintain the value in order to represent the relativity. That’s why theBeofreSendRequest
has the returned value.Here is a related discussion, wish it is useful to you.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/c8de85bf-9ffe-478e-a23c-2514a6504bce/iclientmessageinspector-maintain-id-value-between-the-beforesendrequest-and-afterreceivereply?forum=wcf
Feel free to let me know if there is anything I can help with.