Reputation: 4124
I have implemented message layer security using message inspector mechanism in a wcf service.
On the client side, in IClientMessageInspector.BeforeSendRequest
I add an authentication header.
On the service side, in IDispatchMessageInspector.AfterReceiveRequest
I inspect the authentication header in the message. If it is not found or as expected, I throw a SecurityException
and try to log it to a database.
Here comes the interesting part. When logging to database, I try to read from this webservice again (this is web service which provides configuration info).
This is where the service stalls/deadlocks. I can see that the call to read configuration (when logging to db) is made, but I don't receive the call on the service. I keep getting a timedout exception every time.
After a little googling, I came across this post, which mentions that message inspectors are synchronous in nature. If that is so, how can I achieve what I am after?
Upvotes: 3
Views: 141