Web Services, WCF – What Happens When Client Doesn’t Get the Response?

wcfweb services

We have developed a WCF service which acts as an API to our system.

some of the methods expose functionality which eventually writes and updates data to DB.

Lets say that the client sent one of those requests, the service performed the needed operations while the client disconnects for some reason and did not get the response.

the response holds information about success/failure of all sub-operations

An example of "problematic" data being updated – "Add X amount to Balance of Member M".

So if the client did not get the response – the client doesn't know that the data was updated.

How should we deal with this scenario while keeping the client side implementation as clean as possible?

Best Answer

Send a transaction Id.

The server stores the transaction ID (And the client ID).

When a new transaction is sent the server checks if it has already been processes.. If it has is sends an error code the the client.