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. ...

Get WCF Multi-layer Services Development with Entity Framework Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.