Forwarding Transactions
I want to receive messages that contain a transaction and forward those messages to another service. How do I configure WCF to accept transactions without executing the service method under a transaction?
In normal transactional messaging processing you would use the TransactionScopeRequired attribute to declare your interest in having a transaction. By setting TransactionScopeRequired to true, you are requesting a guarantee that a transaction scope exists when the service method is executed. If you've also set the TransactionFlow attribute to true and the sender flowed a transaction with the message, then that flowed transaction would be used to construct the transaction scope. Otherwise, a new transaction would be created before your service method is invoked.
In this case you want the behavior of supporting a flowed transaction without actually creating the transaction scope. By setting TransactionScopeRequired to false, you are requesting that the service method not be provided with a transaction scope. However, you can still set TransactionFlow to true to allow the sender to flow a transaction with the message. This gives you the flowed transaction to forward to another service without creating unwanted transaction scopes. The incoming messages will include a TransactionMessageProperty if you want to access the flowed transaction.
Next time: Tracing Network Calls
Comments
- Anonymous
June 06, 2008
Is it possible to copy a very large message? The CreateBufferedCopy method of Message requires a quota