In case of failed security authentication, IDispatchMessageInspector won't be triggered?
I implement the IDispatchMessageInspector interface to log the raw request/response me开发者_运维知识库ssage. I apply it via the IEndpointBehavior interface. It works well in most secenarios. But I find the messages does not be logged any more when the authentication fail.(I use TransportWithMessageCredential in the basicHttpBinding). So I start to debug the WCF service and find the inspector doesn't be invoked. What happen to this case?
Thanks in advanced.
The authentication happens before processing any request, once authentication fails, the service won't process any request, of course, IDispatchMessageInspector won't be invoked.
And when the authentication happens, the client won't send any request to the service. If you do want to log the raw message, you may insert a custom BindingElement into the binding.
精彩评论