简体   繁体   English

在 WCF 中发出请求时会触发哪些事件

[英]Which Events are fired When Request Are made in WCF

I wanted to know, when WebGet/WebInvoke requests are made in WCF service which built-in events are fired & can I override them?我想知道,当在 WCF 服务中发出 WebGet/WebInvoke 请求时,会触发哪些内置事件,我可以覆盖它们吗? same for sending a response?发送响应也一样?

In all the events I want to access the Data which is being sent or received.在所有事件中,我都想访问正在发送或接收的数据。

Thanks.谢谢。

best way to do this is:最好的方法是:

http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.idispatchmessageinspector.aspx http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.idispatchmessageinspector.aspx

WCF will invoke your implementation of the dispatch message inspector, after receive request, and before send reply. WCF 将在接收请求之后和发送回复之前调用调度消息检查器的实现。 There you have access to the raw Message instance, you can even modify it if required.在那里您可以访问原始 Message 实例,如果需要,您甚至可以对其进行修改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM