Search code examples
delphisoaptclientdataset

Disconnected Recordset / Dataset for Delphi


I have a 3-tier application written in Delphi 7 that uses a WebBroker-based SOAP server (standalone exe) with the SOAP client program communicating to via a HTTPRIO component.

This is not a DataSnap application. Instead the server sends data to the client as a disconnected ADO recordset in ADTG format that corresponds to the SQL string passed into the SOAP request. (The server first compresses it and converts it to Base64 for easy transmission back to the client as a "string" result.)

I use the returned recordset directly to iterate through its rows and fields (ie without needing to use a DataSet component) as this is something I am comfortable doing due to many years programming in Microsoft Access with VBA. Luckily it is also possible to assign it directly to the Recordset property of a TADODataset component so that I can bind it to a QuickReport.

I now want to upgrade my client program to FireMonkey so that I can compile it for both Windows and OSX and suppose that I won't be able to use ADO Recordsets anymore, at least not in the Mac enviroment.

In preparation for conversion to FireMonkey, what would be the best data format that I can a) disconnect and transmit "by hand", b) load into a dataset component so that I can base reports on it, and c) if possible, work through the data in code without having to first load it into a component?

This last item is important to me not just because I am used to working with data without using components, but also because I frequently request data in a thread in order to retrieve it in the background without locking up the user interface. As I understand it, components and threads don't go together.

Any advice about the best way forward?


Solution

  • I would go into transmitting some per-representation value, e.g. real XML or JSON, instead of some binary base-64 encoded content. And switch to a REST approach, which is much easier to implement on both sides than SOAP.

    You can then fill a TDataSet from a JSON array of objects, or a JSON array of values (if you don't want to transmit the column names as object field names over the wire).

    The advantage of JSON/REST is that you may be able to reuse the very same server logic for publishing its content to a HTML5 javascript client (mobile or web), or a third-party application or service.