How and where to implement the IDispatchMessageInspector

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 17:00:42

问题


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?

来源:https://stackoverflow.com/questions/31171943/how-and-where-to-implement-the-idispatchmessageinspector

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!