DataSnap Server Wizard for Windows
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.
- Select the type of DataSnap Server:
- Click Next.
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.
Server Features page
On this page, you can select the set of features required for your application.
- Select the features you want to add to the DataSnap server.
- Click Next.
- Tip: For more details on each feature, click it and see the description in the Info section.
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.
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.
- To check the availability of the specified port, click Test Port.
- 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.
- Click Next.
X.509 Certificates page
This step appears only if you select the HTTPS communication protocol on the Server Features page.
- 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.
- To validate the selection, click Test.
- Click Next
Server methods ancestor class page
On this page, select the ancestor type of the server methods class.
- Select one of the following ancestor types:
- Click Next.
Project Location page
This step appears only if you selected the Mobile Connectors feature in the Server features page of this wizard.
- 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
.cssfiles, 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); begin DSServer1.Stop; end;
- Click Finish.
- Creating Multi-Tiered Applications Index
- DataSnap WebBroker Application Wizard
- DataSnap Connectors for Mobile Devices
- Mobile Tutorial: Connecting to an Enterprise Database from a Mobile Client (iOS and Android)