Mapping a WCF request message to the underlying operation

荒凉一梦 提交于 2019-12-11 16:41:56

问题


I need to know what operation is being invoked by examining a request Message object in an IDispatchMessageInspector.

What is the best way to do this?


回答1:


There's really no 100% sure way of doing this, because IDispatchMessageInspector.AfterReceiveRequest() runs before the dispatcher has matched the message to an actual operation on the service. That said, if you're using the default IDispatchOperationSelector, then it's possible to build a map that matches SOAP Action names with operation names during ApplyDispatchBehavior(). I have a blog post that talks a little bit about this here.

There's a bit of an example of how to build this map on some code here.



来源:https://stackoverflow.com/questions/1686411/mapping-a-wcf-request-message-to-the-underlying-operation

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