3

Based on the SO question: How to use IDispatchMessageInspector in a WCF Service?

I am still confused on where to implement the methods that execute code to "do something" with the inspected message.

From reading IDispatchMessageInspector it appears that I need to have a class that implements IDispatchMessageInspector which has these two methods AfterReceiveRequest and BeforeSendReply.

However, I am not understanding where to or how to use those methods.

For example if I wanted to modify an element in the inbound request message before it was dispatched to its operation.

Is this done in the class I create for the servicebehavior which implements my ServiceContract Interface?

Community
  • 1
  • 1
Popo
  • 2,402
  • 5
  • 33
  • 55
  • 1
    [MSDN has a detailed example.](https://msdn.microsoft.com/en-us/library/aa717047%28v=vs.110%29.aspx) – nodots Jul 02 '15 at 08:03
  • @nodots, thanks for the link, it was a bit more detailed than what I was looking at. I downloaded the WCF sample projects and was able to step through their code to see what I need to do. – Popo Jul 16 '15 at 21:04

0 Answers0