Testing the transaction behavior of the existing WCF service
Before learning how to enhance this WCF service to support distributed transactions, we will confirm whether the existing WCF service supports distributed transactions.
To do so, we will first create a Windows Presentation Foundation (WPF) client to call the same service twice in one method. We will make the first service call succeed and the second service call fail. After the two service calls, we will verify that the update in the first service call will be committed to the database, even though the second service call fails, which means that the WCF service does not support distributed transactions.
We will then wrap the two service calls in one transaction scope and redo the test. Again, we will verify that the update in the first service call will still be committed to the database, which means the WCF service does not support distributed transactions even if both the service calls are within the scope of one transaction.
Going...