TransactionMessageProperty.Set(Transaction, Message) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the transaction that will be used when executing the service method.
public:
static void Set(System::Transactions::Transaction ^ transaction, System::ServiceModel::Channels::Message ^ message);
public static void Set (System.Transactions.Transaction transaction, System.ServiceModel.Channels.Message message);
static member Set : System.Transactions.Transaction * System.ServiceModel.Channels.Message -> unit
Public Shared Sub Set (transaction As Transaction, message As Message)
Parameters
- transaction
- Transaction
The transaction that will be used when executing the service method.
- message
- Message
The incoming message that results in calling the service method.
Exceptions
The property has already been set on message
.
transaction
needs to be unmarshaled, and that operation fails.
Remarks
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
.