ServiceModel Attributes and ServiceDescription Reference

The description tree is the hierarchy of types (starting with the ServiceDescription class) that together describe every aspect of a service. Windows Communication Foundation (WCF) uses a description tree to build a valid service runtime, to publish Web Services Description Language (WSDL), XML Schema definition language (XSD), and policy assertions (metadata) about the service that clients can use to connect to and use the service, and to generate various code and configuration file representations of the description tree values.

This topic describes how contract-related properties are obtained from the service contract, and how they are implemented and added to the description tree. In some cases, attribute values are converted into behavior properties and behavior is then inserted into the description tree. For more information about how the description tree values are converted into metadata, see ServiceDescription and WSDL Reference.

Mapping Operations to the Description Tree

In WCF applications, service contracts are modeled by interfaces (or classes) that use attributes to mark the interface or class and its methods as a grouping of operations. When a ServiceHost class is opened, any service contracts and implementations are reflected over and merged with configuration information into a description tree.

There are two types of operation models: the parameter model and the message contract model. The parameter model uses managed methods that do not have a parameter or return value type that is marked by the MessageContractAttribute class. In this model, developers control the serialization of parameters and return values, but WCF generates the values that are used to populate the description tree for the service and its contract.

Bindings specified in configuration files are loaded directly into the ServiceEndpoint.Binding property.

ServiceBehaviorAttribute Property Description Tree Value Affected
Name Name
Namespace Namespace
ConfigurationName ConfigurationName
IgnoreExtensionDataObject Sets the IgnoreExtensionDataObject property for all operations.
MaxItemsInObjectGraph Sets the MaxItemsInObjectGraph property for all operations.
ServiceContractAttribute Property Description Tree Value Affected
CallbackContract CallbackContractType, MessageDescription added to all operations Messages.
ConfigurationName ConfigurationName
ProtectionLevel ProtectionLevel and possibly child protection levels. For more information about the protection-level hierarchy, see Understanding Protection Level.
SessionMode SessionMode
ServiceKnownTypesAttribute Value Description Tree Value Affected
MethodName KnownTypes
OperationContractAttribute Value Description Tree Value Affected
Action Action for the output message or input message, depending upon contract/callback contract.
AsyncPattern If true, BeginMethod and EndMethod
IsOneWay Maps to a single MessageDescription in Messages
IsInitiating IsInitiating
IsTerminating IsTerminating
Name Name
ProtectionLevel ProtectionLevel and possibly child protection levels. For more information about the protection-level hierarchy, see Understanding Protection Level.
ReplyAction Action for the output message or input message, depending upon contract/callback contract.
FaultContractAttribute Value Description Tree Value Affected
Action Action depending upon contract/callback contract.
DetailType DetailType
Name Name
Namespace Namespace
ProtectionLevel ProtectionLevel
DataContractFormatAttribute Value Description Tree Value Affected
Use The Style value is set on the DataContractSerializerOperationBehavior for the operation.
XmlSerializerFormatAttribute Value Description Tree Value Affected
Style This XmlSerializerFormatAttribute property is set on the XmlSerializerOperationBehavior for the operation.
Use The XmlSerializerFormatAttribute is set on the XmlSerializerOperationBehavior for the operation.
TransactionFlowAttribute Value Description Tree Value Affected
TransactionFlowOption The TransactionFlowAttribute is added as an operation behavior to the Behaviors property.
MessageContractAttribute Value Description Tree Value Affected
ProtectionLevel ProtectionLevel
WrapperName WrapperName
WrapperNamespace WrapperNamespace
MessageHeaderAttribute Value Description Tree Value Affected
Actor Actor for the corresponding header in Headers
MustUnderstand MustUnderstand for the corresponding header in Headers
Name Name for the corresponding header in Headers
Namespace Namespace for the corresponding header in Headers
ProtectionLevel ProtectionLevel for the corresponding header in Headers
Relay Relay for the corresponding header in Headers
MessageBodyMemberAttribute Value Description Tree Value Affected
Name Name for the corresponding part in Parts
Namespace Namespace for the corresponding part in Parts
Order Index for the corresponding part in Parts
ProtectionLevel ProtectionLevel for the corresponding part in Parts
MessageHeaderArrayAttribute Value Description Tree Value Affected
Actor Actor
MustUnderstand MustUnderstand
Name Name
Namespace Namespace
ProtectionLevel ProtectionLevel
Relay Relay
MessagePropertyAttribute Value Description Tree Value Affected
Name Name
MessageParameterAttribute Value Description Tree Value Affected
Name Name for the corresponding part in Parts

For more information about how the description tree values are converted into metadata, see ServiceDescription and WSDL Reference.

See Also

ServiceDescription and WSDL Reference