0

This is the first time I am using retrofit and I am a little confused.

I have setup a connection between the server and the client without issue. However now I am working on getting callback working correctly. In Retrofit's doc it states

It’s worth noting there are no changes necessary on the server side to get asynchronous execution working correctly.

If this is correct then what am I doing on the server side to retrieve the info on the response? Or am I misunderstanding this process completely?

I should note that I am passing objects and various collections.

B Rad
  • 571
  • 3
  • 9
  • 28
  • The rest service [or service provider] does not have to do anything. In order to support asynchronous calls, only the client has to do what it has to do. Now, what's your question exactly? – TJ- Aug 12 '14 at 19:20
  • I am trying to figure out if there is a way to get a response back from the client once he has successfully completed his task. I thought callback was the correct way to approach this but now I am not sure thats the case. – B Rad Aug 12 '14 at 22:39
  • Is the question not clear or just dumb? – B Rad Aug 13 '14 at 21:05
  • Sorry, I missed your comment. Yes, callback is the correct way. You may want to have a look at this [answer](http://stackoverflow.com/a/17034466/174184) for an example. – TJ- Aug 14 '14 at 04:44
  • @TJ- So I guess the confusion is how do I access that info on the server side. If the client has a response, how is it that I access that response? We have the Success and Fail messages working with logs on the client side. – B Rad Aug 14 '14 at 14:06
  • I guess we are using different terminologies here. By server side, I am referring to the service provider. By client, I am referring to the Service Consumer. Retrofit sits at the client side. Now, is this your confusion - How to make use of the response that is received by the `success` method of the registered callback? – TJ- Aug 14 '14 at 15:00
  • @TJ- I suppose. However I guess I am using it backwards then. The way my process works is the client requests data, I hand the data through and it is accepted. Is there a way for the client to then acknowledge successful receipt of the data? So there would be a total of three handoffs. Request -> Response -> Acknowledgment – B Rad Aug 14 '14 at 15:21
  • 1
    You mean, acknowledge it to the Server? In the rest-ful world, you will have to expose another endpoint on the server that would 'accept' acknowledgements. Upon receiving the information from the server, the client would make another call to the 'acknowledgement' endpoint - is what I think. `Request -> Response -> Accept_Acknowledgement_Request -> Optional_Response` – TJ- Aug 14 '14 at 15:29
  • That isn't what I wanted to hear but that was my understanding as well. Thank you for clarifying. – B Rad Aug 14 '14 at 15:51
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/59374/discussion-between-b-rad-and-tj). – B Rad Aug 14 '14 at 16:20

0 Answers0