OperationDescription Class
Represents the description of a contract operation that provides a description of the messages that make up the operation.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
The OperationDescription type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | OperationDescription | Initializes a new instance of the OperationDescription class with a specified name and contract description. |
| Name | Description | |
|---|---|---|
![]() ![]() | BeginMethod | Gets or sets the begin method of the operation. |
![]() | Behaviors | Gets or sets the operation behaviors associated with the operation. |
![]() ![]() | DeclaringContract | Gets or sets the contract to which the operation belongs. |
![]() ![]() | EndMethod | Gets or sets the end method of the operation. |
![]() ![]() | Faults | Gets the descriptions of the faults associated with the operation description. |
![]() | HasProtectionLevel | Gets a value that indicates whether the operation has had a protection level set. |
![]() | IsInitiating | Gets or sets a value that indicates whether the method implements an operation that can initiate a session on the server (if such a session exists). |
![]() ![]() | IsOneWay | Gets or sets a value that indicates whether an operation returns a reply message. |
![]() | IsTerminating | Gets or sets a value that indicates whether the service operation causes the server to close the session after the reply message, if any, is sent. |
![]() ![]() | KnownTypes | Gets the known types associated with the operation description. |
![]() ![]() | Messages | Gets or sets the descriptions of the messages that make up the operation. |
![]() ![]() | Name | Gets or sets the name of the operation description. |
![]() | ProtectionLevel | Gets or sets the protection level for the operation. |
![]() ![]() | SyncMethod | Gets or sets the service synchronization method of the operation description. |
| Name | Description | |
|---|---|---|
![]() ![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() ![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() ![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() ![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ShouldSerializeProtectionLevel | Returns a value that indicates whether the ProtectionLevel property has changed from its default value and should be serialized. |
![]() ![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
A contract is a collection of operations that specifies what the endpoint communicates to the outside world. Each operation is a message exchange. For example, a request message and an associated reply message forming a request/reply message exchange.
A ContractDescription object is used to describe contracts and their operations. Within a ContractDescription, each contract operation has a corresponding OperationDescription that describes aspects of the operation, such as whether the operation is one-way or request/reply. Each OperationDescription also describes the messages that make up the operation using a collection of MessageDescription objects. ContractDescription contains a reference to an interface that defines the contract using the programming model. This interface is marked with ServiceContractAttribute, and its methods that correspond to endpoint operations are marked with OperationContractAttribute.
Many of the properties on OperationDescription have corresponding properties in the programming model on OperationContractAttribute, for example, IsTerminating.
The following example uses the OperationDescription returned from the collection returned by the Operations property of the ContractDescription class. The code iterates through the collection of endpoints and prints each endpoint name, as well as the name of each operation in the endpoint.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

