DataSnap.FireDACJSONReflect REST Server Client Sample

From RAD Studio Code Examples
Jump to: navigation, search

This sample demonstrates the use of the Data.FireDACJSONReflect unit to pass FireDAC datasets and deltas between a DataSnap client and a DataSnap REST server.


You can find the FireDACJSONReflect sample project at:


This sample demonstrates how to build a multi-tier application with DataSnap framework.

The server and the client communicate using the HTTP protocol to exchange JSON data through a REST interface.


  • The server is a DataSnap REST web application that accesses data from an InterBase database.
  • The sample adds FireDAC components to the Server Module to connect to an Interbase database.
  • The sample adds new methods in ServerMethodsUnit1 to retrieve JSON data from the underlying InterBase EMPLOYEE sample database, and to expose these server methods to the client.


  • The client is a multi-device application that includes a DataSnap REST Client Module.
  • The client calls the server methods to retrieve the data from the server.
  • The client also calls a method to apply changes to the database storing and passing data through TFDMemTable components.

How to Use the Sample

  1. Navigate to Start | Programs | Embarcadero RAD Studio Alexandria | Samples and go to Object Pascal\DataSnap\FireDACJSONReflect.
  2. Select DepartmentsClientProject.dproj and DepartmentsServerProject.dproj.
  3. Open the client and the server.

Server Project

  1. Select DepartmentServerProject.exe on the Project Manager.
  2. Run the application by clicking Run > Run Without Debugging in the IDE or by pressing Shift+Ctrl+F9.
  3. The Server's interface opens. Click Start to start the server and then minimize it.

Client Project

  1. Select DepartamentClientProject.exe on the Project Manager.
  2. Run the application by clicking Run > Run in the IDE or by pressing F9.
  3. The Client application enables you to test the server method classes.
    • Click Get Departments to display a list of department names and numbers.
    • Click on a department to see department details and employees.
    • Modify a value in the department details and/or employee and then click Apply Updates to send changes to the server.


The files used by this sample are:

Server Files

File Contains


The DataSnap Server Components.


The Server module with the FireDAC components.


The project itself.


The Server form.

Client Files

File Contains


The project itself.


The main form that is the user interface for the DataSnap Client application.


The module with the TDSRestConnection component.


The client classes from the server generated with the TDSRestConnection component.


See Also