Take the 2-minute tour ×

According this article in MSDN, the evaluation order of WCF behaviors is:

  1. Contract
  2. Operation
  3. Endpoint
  4. Service

I have a service that uses a ServiceAuthorizationManager class to perform some custom security validation for requests. This authorization manager is hooked into a ServiceAuthorizationBehavior which implements IServiceBehavior.

I also have custom behavor defined that implements IEndpointBehavior.

According the order above, endpoint behaviors are supposed to be evaluated before service behaviors, however, logging proved otherwise. The ServiceAuthorizationBehavior was being evaluated before the endpoint behavior.

Is this a bug? What is going on here?

Thanks, Mohammed

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

The documentation is incorrect. The actual order is

  1. Service
  2. Contract
  3. Endpoint
  4. Operation

Thanks for pointing this issue, I'll notify the documentation team to have this fixed.

share|improve this answer
Awesome, thanks for letting me know. For a moment I thought there was an exception made for the ServiceAuthorizationBehavior. I tested this out further by adding a custom OperationBehavior and, indeed, you are correct, the evaluation order is backwards in the documentation –  Mohammed Ali May 14 '12 at 2:45
add comment

Your Answer


