DataSnap WebBroker Application Wizard

From RAD Studio
Jump to: navigation, search

Go Up to DataSnap Server Application

Go Up to File Menu


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

The DataSnap WebBroker Wizard provides an easy way to implement a server application using both the WebBroker and DataSnap technologies. Regardless of the options you select, the wizard creates a unit that contains the following components:

All the additional components are connected to the TDSServer, having the Server property set to the name of the TDSServer component. The communication protocol between server and client applications is either HTTP or HTTPS.

The WebBroker technology is used to send the server response in HTML format.

The DataSnap WebBroker Application Wizard has four to seven steps, depending on the type of application selected in the first step, and the selection of the HTTPS communication protocol and/or the Mobile Connectors. Within the pages of the wizard, click any option to reveal a hint in the upper side of the wizard.

WebBroker Project Type page

DSWebBroker1.png


In the first step of the wizard you are prompted to select the type of the WebBroker Application. The possible options are listed in the following table:


Option Description

Stand-alone application

A stand-alone WebBroker application is a web server that displays a form. It supports HTTP by using an Indy HTTP server component.

Stand-alone console application

A stand-alone WebBroker console application is a web server that has a text-only user interface. It supports HTTP by using an Indy HTTP server component.

ISAPI dynamic link library

ISAPI and NSAPI Web server applications are shared objects that are loaded by the Web server. Client request information is passed to the DLL as a structure and evaluated by TISAPIApplication. Each request message is handled in a separate execution thread. When you select this type of application, the library header of the project files and the required entries are added to the uses list. Also, the clause of the project file is exported. ISAPI libraries integrate with IIS. IIS has support for HTTP and HTTPS.

Apache dynamic link module

The Apache Web server 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 has support for HTTP and HTTPS.

Application Type page

DSAppType.png

This step of the DataSnap WebBroker Application Wizard is available only if you choose Stand-alone application in the previous step of the wizard. In this step you have to specify the type of application you want to create.

The available options are:

  • VCL application
  • FireMonkey application

Apache Module Options page

ApacheModule.png

This page is displayed only if you selected Apache dynamic link module as the type of your project in the first step of this wizard.

Here you are prompted for the following information:

  • Apache version
  • Apache module
  • Apache unit

Port Number page

DSWebBroker2.png

This step of the DataSnap WebBroker Application Wizard is available only if you choose Stand-alone application or Stand-alone console application in the first step of the wizard. Here you are prompted to enter the HTTP communication port. The wizard also offers the possibility to test the availability of that port using the Test Port button. The Find Open Port button auto-completes the HTTP Port field with a free open port number, auto-detected by the DataSnap WebBroker Application Wizard.

Note: To use the HTTPS protocol, you must select the HTTPS check box. If HTTPS is selected, then the wizard will have an additional step that prompts for information regarding the X.509 certificate files. The HTTPS communications port will be set to 443, which is a commonly used port by IIS.

X.509 Certificates page

DSWebBroker3.png


This step appears only if you select the HTTPS communication protocol in the previous step of this wizard. Here you are requested to enter the following information in order to enable HTTPS:

  • File name that holds the X.509 certificate (*.pem).
  • File name that holds the key.
  • File name that contains the password for the key file.
  • File name that holds the root certificate.

To validate the selection, press the Test button.

Server Features page

DSWebBroker4.png


In this page you are asked about the DataSnap WebBroker server features.

If you select the Authentication option, a TDSAuthenticationManager component is placed 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.

Select the Server Method Class option to add a TDSServerClass component to the server form and to allow defining a class on the server that will expose the server methods to the client applications.

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

The last category in the list is Filters. You can chose to include an Encryption filter, a Compression filter, or both:

  • The Encryption filter adds a 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 will connect to this server.
  • The Compression filter adds a ZLib compression filter for the selected communications protocols.

Selecting the Mobile Connectors option enables you to include support for proxy dispatching for mobile connector development.

The Server Module check box enables you to create a separate module for DataSnap server components. This enables support for heavyweight callbacks in DataSnap WebBroker applications.

Server methods ancestor class page

DSWebBroker5.png


This step of DataSnap WebBroker Application Wizard asks for the ancestor type for the server method class.

  • Choose TComponent if you want to entirely implement the server class.
  • Choose TDataModule if you want to use nonvisual components in your server class.
  • Choose TDSServerModule to expose datasets from the server to client applications.

Project location page

DSWebBroker6.png

The last step of the DataSnap WebBroker Application Wizard asks for the project location. 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.

To finish the wizard, click the Finish button.

See Also