Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wcf Request Lifecycle

Tags:

.net

wcf

Is there a lifecycle that WCF requests go through? Specifically I need to be able to intercept and possibly cancel requests made before they get to the method that was invoked.


1 Answers

You need to implement an IDispatchMessageInspector and inject it in the serivce behavior stack.

use IDispatchMessageInspector.AfterReceiveRequest to accept or reject a request.

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

and

http://www.codeproject.com/KB/WCF/WCFIPfilter.aspx

like image 54
Claudiu Mihaila Avatar answered Apr 29 '26 20:04

Claudiu Mihaila



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!