Message Inspector with Custom Behavior and IClientMessageInspector

Message Inspector with Custom Behavior and IClientMessageInspector

  • Comments 1

My goal was to to make a simple MessageInspector so that I can see what message is going out at some point and probably add some info into the headers at the client side. Now the SDK had quite a good sample of the message inspector implementation but I was looking for something like a hello world.


The point is how you tie up following.

1. Add a custom behavior to the proxy endpoint.
                      proxy.Endpoint.Behaviors.Add(new CustomBehavior());

2. Add the IClientMessageInspector to the behavior in the ApplyClientBehavior of the custom behavior
                      behavior.MessageInspectors.Add(new CustomMessageInspector());

3. Implement the BeforeSendRequest or AfterRecieveReply to get the message

Do provide your inputs on how this can be better used.

Attachment: CustomBehavior.zip
Leave a Comment
  • Please add 7 and 8 and type the answer here:
  • Post
  • Hi, Can I do this even if I have no control over the service

Page 1 of 1 (1 items)
Search