System.ServiceModel 4.0.0.0 System.Attribute System.ServiceModel.Description.IOperationBehavior System.AttributeUsage(System.AttributeTargets.Method)

Use the attribute to indicate what operation-specific execution behavior the operation has when executed. (To specify execution behavior at the service level, use the attribute.)

You can also use to configure a callback contract operation in a duplex client application. When used on a callback operation, the property must be or an exception is thrown at runtime.

The attribute is a indigo1 programming model feature that enables common features that developers otherwise must implement themselves.

The property controls whether parameter objects passed to an operation are disposed when the operation completes.

The property specifies whether the transaction in which the method executes is automatically committed if no unhandled exceptions occur.

The property specifies whether a method must execute within a transaction.

The property specifies whether the service operation can, must, or cannot impersonate the caller's identity.

The property specifies when service objects are recycled during the method invocation process.

Specifies the local execution behavior of a service method.

- Constructor
  4.0.0.0

  The default constructor creates an instance of the class with the following defaults:

  The property is true.

  The property is false.

  The property is .

  The is .

  Initializes a new instance of the class.

- Property
  4.0.0.0
  System.Boolean To be added.

  This property determines whether the service disposes all disposable parameters (input, output or reference parameters) that were created while processing a message. The default value is true. Set this property to false if you want to prevent the system from disposing of resources and cache them if required.

  For example, if is false, then the sender is responsible for closing the stream on the sending side.

  Gets or sets whether parameters are to be automatically disposed.

- Property
  4.0.0.0
  System.ServiceModel.ImpersonationOption To be added.

  Use the property (together with a binding configuration that supports impersonation) to enable specified methods (those marked with the property set to or ) to execute under the caller's identity. For details, including how impersonation is performed when using together with the property, see Delegation and Impersonation with WCF and How To: Impersonate a Client on a Service.

  When programmatically adding a service endpoint that performs impersonation, you must either use one of the methods or the method to properly load the contract into a new object. Using a configuration file requires no extra step.

  There may be specific scenarios when impersonation is not supported. crdefault Unsupported Scenarios.

  Gets or sets a value that indicates the level of caller impersonation that the operation supports.

- Property
  4.0.0.0
  System.ServiceModel.ReleaseInstanceMode To be added.

  Use the property to specify when indigo1 recycles a service object in the course of executing a method. The default behavior is to recycle a service object according to the value. Setting the property changes that default behavior.

  The makes no threading guarantees. If you must have a new, unmodified object when your service runs, set the property to .

  In transaction scenarios, the property is often used to ensure that old data associated with the service object is cleaned up prior to processing a method call. You can also ensure that service objects associated with transactions are recycled after the transaction successfully completes by setting the property to true.

  You can choose the following behaviors:

  Recycle a service object before an operation is called.

  Recycle a service object after an operation is called.

  Recycle a service object both before and after an operation is called.

  No recycling behavior.

  You can also use to configure a callback contract operation in a duplex client application. When used on a callback operation, the property must be or an exception is thrown at runtime.

  In addition, it is important to realize that if the service is created by passing a service object to the constructor, the value of this property is treated as if it were .

  Gets or sets a value that indicates when in the course of an operation invocation to recycle the service object.

- Method
  4.0.0.0
  System.Void `` `` To be added.

  Implements the method.

  The operation description modified to support properties. Binding parameters passed to support binding behaviors.
- Method
  4.0.0.0
  System.Void `` `` To be added.

  Implements the client operation behavior.

  The operation description modified to support properties. The extensibility access point to insert custom client modifications for this operation.
- Method
  4.0.0.0
  System.Void `` `` To be added.

  Implements the service operation behavior.

  The operation description modified to support properties. The extensibility point to insert custom service modifications for this operation.
- Method
  4.0.0.0
  System.Void `` To be added.

  Implements the validation behavior.

  The operation description to validate.
- Property
  4.0.0.0
  System.Boolean To be added.

  Set the property to false to complete or abort transactions directly in the code for the operation.

  Handled exceptions can be thrown in the course of the operation without automatically aborting the transaction. Only unhandled exceptions trigger an automatic abort.

  Gets or sets a value that indicates whether to automatically complete the current transaction scope if no unhandled exceptions occur.

- Property
  4.0.0.0
  System.Boolean To be added.

  Set the to true to require your operation to execute within a transaction scope. If a flowed transaction is available, the operation executes within that transaction. If one is not available, a new transaction is created and used for the operation execution. The binding specified in the endpoint controls whether flowed transactions are supported. Therefore, to obtain the proper behavior you must understand the interaction between whether transaction flow is permitted by the binding and the property. The following table shows the possible behavior.

  TransactionScopeRequired

  Binding permits transaction flow

  Caller flows transaction

  Result

  False

  False

  No

  Method executes without a transaction.

  True

  False

  No

  Method creates and executes within a new transaction.

  True or False

  False

  Yes

  A SOAP fault is returned for the transaction header.

  False

  True

  Yes

  Method executes without a transaction.

  True

  True

  Yes

  Method executes under the flowed transaction.

  Gets or sets a value that indicates whether the method requires a transaction scope for its execution.