Reputation: 1842
I need to validate the request in all the operation contracts. The request base will have user authentication token which needs to be validated every time.
I need to invoke a method in WCF (basically to validate this request) before all my operation contracts are gets called. Otherwise I have to write the code to validate the request in all the operation contract methods.
Is there any option in WCF for this?
Upvotes: 3
Views: 1311
Reputation: 1490
WCF offers several extensibility points. You could check IDispatchMessageInspector.AfterReceiveRequest
which allows you to inspect an incoming message before it is dispatched to the operation.
Upvotes: 3