Partager via


ClientOperation Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Used to modify or extend the execution behavior of a specific contract operation in a client object or client channel object. This class cannot be inherited.

Inheritance Hierarchy

System.Object
  System.ServiceModel.Dispatcher.ClientOperation

Namespace:  System.ServiceModel.Dispatcher
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

Syntax

'Declaration
Public NotInheritable Class ClientOperation
public sealed class ClientOperation

The ClientOperation type exposes the following members.

Constructors

  Name Description
Public methodSupported by Silverlight for Windows Phone ClientOperation(ClientRuntime, String, String) Initializes a new instance of the ClientOperation class using the specified ClientRuntime, name, and action values.
Public methodSupported by Silverlight for Windows Phone ClientOperation(ClientRuntime, String, String, String) Initializes a new instance of the ClientOperation class using the specified ClientRuntime, name, action, and reply action values.

Top

Properties

  Name Description
Public propertySupported by Silverlight for Windows Phone Action Gets the action of the operation.
Public propertySupported by Silverlight for Windows Phone BeginMethod Gets or sets the method associated with an asynchronous operation.
Public propertySupported by Silverlight for Windows Phone DeserializeReply Gets or sets a value that indicates whether the Formatter property value is used to deserialize the reply message.
Public propertySupported by Silverlight for Windows Phone EndMethod Gets or sets the method that implements the asynchronous end method for the operation.
Public propertySupported by Silverlight for Windows Phone Formatter Gets or sets the formatter that serializes objects into messages and deserializes messages into objects.
Public propertySupported by Silverlight for Windows Phone IsInitiating Gets or sets a value that indicates whether a session can be started by a message to this operation.
Public propertySupported by Silverlight for Windows Phone IsOneWay Gets or sets a value that indicates whether the operation is a one-way operation.
Public propertySupported by Silverlight for Windows Phone IsTerminating Gets or sets a value that indicates whether this operation is the last one in a session.
Public propertySupported by Silverlight for Windows Phone Name Gets the name of the operation.
Public property ParameterInspectors Gets a list of IParameterInspector objects that can inspect and modify inbound and outbound objects for a particular client method.
Public propertySupported by Silverlight for Windows Phone Parent Gets the containing ClientRuntime object.
Public propertySupported by Silverlight for Windows Phone ReplyAction Gets the action of the reply message for this operation.
Public propertySupported by Silverlight for Windows Phone SerializeRequest Gets or sets a value that specifies whether the Formatter object serializes an outbound message.
Public propertySupported by Silverlight for Windows Phone SyncMethod Gets or sets the method that is associated with this operation.

Top

Methods

  Name Description
Public methodSupported by Silverlight for Windows Phone Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows Phone Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone GetType Gets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows Phone MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

The ClientOperation class is the location for client runtime modifications and insertion point for custom extensions that are scoped to a single service operation. (To modify client run-time behavior for all messages in a contract, use the ClientRuntime class.)

Install ClientOperation modifications using a custom client behavior object, either of type IContractBehavior (to find a particular operation to modify) or of type IOperationBehavior (which can then be applied by creating a custom attribute).

Use the Operations property to locate the ClientOperation object that represents a particular service operation.

The following properties enable you to insert custom objects or modify the client execution behavior:

  • Use the Formatter property to insert a custom IClientMessageFormatter implementation for an operation or modify the current formatter.

  • Use the SerializeRequest property to control who serializes an outbound message.

  • Use the DeserializeReply property to control who deserializes an inbound message.

  • Use the Action property to access the WS-Addressing action of the request message and the ReplyAction property to access the response message action.

  • Use the BeginMethod and EndMethod to specify which client methods are associated with an asynchronous operation.

  • Use the IsInitiating and IsTerminating properties to control whether a session is initiated or is torn down, respectively, when the operation is called.

  • Use the IsOneWay property to control whether the client waits for a response before completing the invocation.

  • Use the Parent property to obtain the containing ClientRuntime object.

  • Use the Name property to get the name of the operation.

  • Use the SyncMethod property to control which method is mapped to the operation.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.