2
votes

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

1

1 Answers

5
votes

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.