Asynchronous Services

With the current components I use to provide services between applications and to the internet they return the result in an onresult event so do not block my main application if the server is unavailable e.g. no internet connection.

Whereas XData call to the service (as below) will stop the application until it times out. 
SumResult := MyService.Sum(510);

Should I somehow be using TXDataWebClient in place if TXDataClient as it seems to be asynchronous ? So the above would change to XDataWebClient1.Get('Sum', 5, 10); ?

The straightforward way to use it is simply create a thread (or task) yourself and call the method from there. 

Hi Wagner, if we use your solution, we still are not able to cancel the request (if we cannot wait for the timeout). Do you have any suggestions on that?

TXDataClient doesn't have a mechanism for canceling the request besides using timeout, indeed. But if it's in a thread, can't you simply wait for the timeout?