Freigeben über


Validation Behaviors for Client and Service

The other day I talked about the built-in service validation behaviors but these behaviors are only a part of the overall validation story. Today I've got more of an end-to-end overview of behavior validation. Although validation is similar whether you're building a client or service (remember that client proxies have behaviors too) I'll also point out where the differences take place.

How a service performs behavior validation:

1.
Run built-in service behaviors
2.
Run user-defined service behaviors
3.
For each endpoint on the service:
1.
Run user-defined contract behaviors
2.
Run user-defined endpoint behaviors
3.
For each operation on the contract:
1.
Run user-defined operation behaviors

How a client performs behavior validation:

1.
Run user-defined contract behaviors
2.
Run built-in endpoint behaviors (these are mostly the same as the built-in service behaviors but not all of the checks are performed for the client)
3.
Run user-defined endpoint behaviors
4.
For each operation on the contract:
1.
Run user-defined operation behaviors

If more than one endpoint shares a contract, then the contract behaviors will run again and again while the operation behaviors will only run once. That's because an IContractBehavior operates on the contract and endpoint while an IOperationBehavior operates on the operation and contract.

Next time: Single Reader for MSMQ

Comments