views:

63

answers:

2

I need to know if a client of my web service has successfully received a message. If the client does not receive the message (network goes down for the client in the middle of the call), I want to rollback my changes, so the next call they make will give them the same data that they attempted to get the first time.

Each call to the web service gives them a sequential "page" worth of data, and I don't want them to miss a "page". If I can't tell when the transmission fails, I will not be able to roll back so the client will potentially have to call support to tell them about the missing "page".

I tried killing the client process in the middle of a lengthy call, while the server was still doing some data processing, but the server just kept right on going and finished successfully.

This is a Java web service using Axis2 and JBoss with SOAP. I am digging into the documentation for some settings about this, so hopefully it is possible to configure.

A: 

You should be getting back a response status code from the web service. Don't consider a call to the webservice to be successful until you get back a "200 - Ok".

Mike Buckbee
Unless I'm mistaken OP wants to know if the server can detect if the client has received the response.
Vineet Reynolds
That is correct. Does the server get a response code from the client?
Tony Eichelberger
Sorry, I had what you were trying to do flipped. I'll echo sbeardsly, you'll need to explicitly add a "successful" return message from the client to pull this off.
Mike Buckbee
+2  A: 

I don't think there is a built in way for the client give an Ack that it has received the payload. So you may need to build it in to your business process.

I have seen this done a few different ways.

  • Provide the client with an element that specifies it is receiving payload x of y, if the client doesn't pick up a specific payload due to network issues, it can request that specific payload again.
  • If it is an all or nothing scenario, then have the client request some sort of token from the web service at the beginning of the transaction and then after it has picked up all of its "pages" then the client can make another call that will let the web service know that the transaction was completed.

Hope that helps.

sbeardsley
That does help. I was hoping HTTP would have some kind of built in mechanism to inform the server when the transmission of the data over the wire was incomplete. Hmmm, oh well.
Tony Eichelberger