Share via


Built In ServiceHost Validation Behaviors

Yesterday I talked about the validation done on bindings for partial trust. Partial trust validation gets run very early when the service host is opened using a service behavior. There are actually several of these service behaviors that run up front. Afterwards, Validate is called on each of your service behaviors to perform the user-extensible part of validation. Here is what those built in validation behaviors do:

  • Partial trust validation is performed to check that all of the endpoints have bindings that are supported for partial trust.
  • Contract name validation is performed to check that all of the contracts that are used across the service have different names if the contracts are different.
  • Security validation is performed to check a very large number of security-related misconfigurations, such as whether contracts that have a defined protection level are being used with bindings that don't support that protection level.
  • Transaction validation is performed to check a variety of transaction-related misconfigurations, such as whether transaction options are being configured when none of the operations require a transaction scope.
  • Peer-to-peer contract validation is performed to check that endpoints that use a peer-to-peer binding are only used with one-way operations.
  • MSMQ integration validation is performed to check that endpoints that use an MSMQ integration binding are only used with the limited set of message contracts supported by integration mode.

Next time: Mystery of the Disappearing Addressing Headers