DataSnap Server Wizard for Windows

From RAD Studio
Jump to: navigation, search

Go Up to DataSnap Server Wizard

File > New > Other > Delphi Projects > DataSnap Server > DataSnap Server
File > New > Other > C++Builder Projects > DataSnap Server > DataSnap Server

To create the DataSnap application for Windows platform, follow the steps below.

Project type page

On this page, you can select the type of DataSnap Server for your application.

  1. Select the type of DataSnap Server:
  2. Click Next.

DataSnapServer win01.png

Application Type page

On the Application Type page, select the type of application you want to create. You can select either VCL or FireMonkey type.

  1. Select the application type:
  2. Click Next

DataSnapServer win02.png

Server Features page

On this page, you can select the set of features required for your application.

  1. Select the features you want to add to the DataSnap server.
  2. Click Next.
Tip: For more details on each feature, click it and see the description in the Info section.

DataSnapServer win03.png


Select protocols in each combination you want, but make sure that TCP/IP is always selected. Selecting a communication protocol from this list enables the selection of the communication ports for the protocols that are selected in the next step of the DataSnap Server Wizard.

Note: If you select HTTPS as the communication protocol, the DataSnap Server Wizard displays an additional page, asking for information regarding the certificate files.


Select the Authentication option to place the TDSAuthenticationManager on the server form.

The TDSHTTPService component uses TDSAuthenticationManager as the AuthenticationManager to allow the implementation of HTTP user authentication for the DataSnap server. The implementation consists in implementing the Authenticate event. When Authentication is selected, the client must provide the DataSnap user name and password as SQL connection properties.

Server Methods Class

Select the Server Methods Class option to add the TDSServerClass component to the server form. It allows defining a class on the server, which exposes server methods to client applications.

If you select the Sample Methods option, then the ServerMethodsUnit will contain the implementation of two simple methods called EchoString and ReverseString, which return the Value given as parameter in normal respective reversed states.


Specify the Filters that the DataSnap Server employs. You can include the Encryption filter, the Compression filter, or both:

  • Select the Encryption filter to add PC1 and RSA filters for the selected communication protocols. Note that the RSA filter requires the OpenSSL libraries to be present on the server and on any client that connects to this server.
  • Select the Compression filter to add a ZLib compression filter for the selected communications protocols.


JavaScript files set up the project with the JavaScript framework and proxy generator.

Mobile Connectors

Select Mobile Connectors to enable your project to support proxy dispatching for applications on mobile devices such as Android, Windows 7 Phone, and iPhone.

Note: For more information, see DataSnap Connectors for Mobile Devices.

Port Numbers page

On this page, specify the ports that the DataSnap will use to listen to the client requests.

  1. To check the availability of the specified port, click Test Port.
  2. To select an opened port that the DataSnap Server automatically detected, click Find Open Port.
    Tip: If you selected the HTTPS feature in the previous step, you have to specify the HTTPS communications port also. The same buttons as for the TCP/IP communication port are available: Test Port and Find Open Port.
  3. Click Next.

DataSnapServer win04.png

X.509 Certificates page

This step appears only if you select the HTTPS communication protocol on the Server Features page.

  1. To use the X.509 certificates, enter the following data:
    • Certificate file name: holds the X.509 certificate (*.pem).
    • Key file name: holds the key.
    • Key file password: contains the password for the key file.
    • Root certificate file name:holds the root certificate.
  2. To validate the selection, click Test.
  3. Click Next

DataSnapServer win05.png

Server methods ancestor class page

On this page, select the ancestor type of the server methods class.

  1. Select one of the following ancestor types:
    • TComponent: to entirely implement the server class.
    • TDataModule: to use nonvisual components in your server class.
    • TDSServerModule: to expose datasets from the server to client applications.
  2. Click Next.

DataSnapServer win06.png

Project Location page

This step appears only if you selected the Mobile Connectors feature in the Server features page of this wizard.

  1. Enter the root directory of the web application. This is the output directory of the project executable and the location of web application files such as .js, .html, and .css files, and other static files.
    Note: Server components are linked among themselves, and the destruction order is important when the server is active. It is a good idea to turn off any DataSnap server instances before closing the form; a code example is suggested below.
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
  1. Click Finish.

DataSnapServer win07.png

See Also