DataSnap REST Application Wizard for Linux

From RAD Studio
Jump to: navigation, search

Go Up to DataSnap REST Application Wizard


File > New > Other > Delphi Projects > DataSnap Server > DataSnap REST Application

To create the DataSnap REST Application for Linux, select Linux in the DataSnap REST Application Wizard and follow the steps below.

WebBroker Project Type page

On this page, select the type of DataSnap REST Application.

  1. Select the required type of DataSnap REST Application:
    • Apache dynamic link module: a server that hosts static or dynamic websites, providing secure and efficient web server features as CGI (Common Gateway Interface), SSL (Secure Sockets Layer), and virtual domains. Apache supports HTTP and HTTPS.
    • Stand-alone console application: sets up an environment for developing Web server console applications.
  2. Click Next.

DataSnapREST linux01.png

Port Number page

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

  1. To check the availability of the specified port, click Test Port.
  2. To select an open port automatically detected by the DataSnap REST Application, click Find Open Port.
Note: Select the HTTPS check box to use the HTTPS protocol. The HTTPS communications port will be set to 443, which is a commonly used port by IIS, and the wizard will display an additional step that prompts for information regarding the X.509 certificate files.

DataSnapREST linux02.png

X.509 Certificates page

This step appears only if you select the HTTPS communication protocol on the Port Number 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

DataSnapREST linux03.png

Apache Module Options page

This page opens only if you selected the Apache dynamic link module on the WebBroker Project Type page.

On this page, enter the data required to create the Apache module.

  1. Select the Apache version.
  2. Select the Apache module.
  3. Enter the Apache unit.
  4. Click Next.

DataSnapREST linux04.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 REST Application.
  2. Click Next.
Tip: For more details on each feature, click it and see the description in the Info section.

DataSnapREST linux05.png

Authentication

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

The TDSHTTPWebDispatcher 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 property. When Authentication is selected, the client needs to 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.

Selecting the Sample Web Files option results in adding a set of sample web files and related pages to this project. They all can be seen in the Projects Window under this DataSnap server project. Inspect the files inside the templates directory to observe the actual Web implementation for the ServerFunctionInvoker and ReverseString methods.

Simplified Dispatcher

Use TDSRESTWebDispatcher rather than TDSHTTPWebDispatcher. The REST dispatcher supports REST only. The HTTP dispatcher also supports DBX/Native HTTP connections.

Mobile Connectors

Select Mobile Connectors to include support for proxy dispatching for mobile connector development.

Server Module

Select the Server Module option to create a separate module for DataSnap server components. This enables support for heavyweight callbacks in DataSnap REST Applications.

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 provide a simple code-only implementation.
    • TDataModule: to use nonvisual components in your server class.
    • TDSServerModule: to expose datasets from the server to client applications.
  2. Click Next.

DataSnapREST linux06.png

Project location page

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

  1. Click Browse.png and select the root location where your application will be stored.
    Tip: Type in the root directory of the web application you are about to create. This is the output directory of the project executable and the location of web application files such as .js, .html, and .css, and other static files.
  2. Click Finish.

DataSnapREST linux07.png

See Also