TransactionMessageProperty::Set Method (Transaction^, Message^)
Sets the transaction that will be used when executing the service method.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Parameters
- transaction
-
Type:
System.Transactions::Transaction^
The transaction that will be used when executing the service method.
- message
-
Type:
System.ServiceModel.Channels::Message^
The incoming message that results in calling the service method.
| Exception | Condition |
|---|---|
| FaultException | The property has already been set on message. |
| TransactionException | transaction needs to be unmarshaled, and that operation fails. |
A custom incoming channel (which is part of a service’s channel stack) can call this method to add a TransactionMessageProperty, containing the transaction parameter, to the Properties collection of the message parameter. This prompts the infrastructure to create a TransactionScope instance using the transaction passed in, before calling the service method requested in the incoming message. The service method must have the TransactionScopeRequired property set to true.
Available since 3.0