Creating the Server Application

From RAD Studio
Jump to: navigation, search

Go Up to Creating Multi-Tiered Applications Index

You create an application server very much as you create most database applications. The major difference is that the application server uses a data module.

To create a server application

Note: Some of the following wizards require a new VCL Form application project and, for Transactional Data Module, you need to have added to the project an ActiveX Library, which can be found on the ActiveX page.

  1. Start a new project:
    Save the new project.
  2. Add a new remote data module to the project. Except for Server Data Module (which can be added from DataSnap Server Wizard), choose File > New > Other , and on the Multitier or WebServices page of the New Items dialog box, select:
    • Remote Data Module if you are creating a COM Automation server that clients access using DCOM, HTTP, or sockets.
    • Transactional Data Module if you are creating a data module that runs under COM+ (or MTS). Connections can be formed using DCOM, HTTP, or sockets. However, only DCOM supports the security services. (In order to access the wizard, you need to have added to the project an ActiveX Library, which can be found on the ActiveX page.)
    • SOAP Server Data Module if you are creating a SOAP server in a Web Service application.For more detailed information about setting up a remote data module, see Setting up the data module.
  3. Place the appropriate dataset components on the data module and set them up to access the database server.
  4. Place a TDataSetProvider component on the data module for each dataset you want to expose to clients. This provider is required for brokering client requests and packaging data. Set the DataSet property for each provider to the name of the dataset to access. You can set additional properties for the provider. See Using provider components for more detailed information about setting up a provider.If you are working with data from XML documents, you can use a TXMLTransformProvider component instead of a dataset and TDataSetProvider component. When using TXMLTransformProvider, set the XMLDataFile property to specify the XML document from which data is provided and to which updates are applied.
  5. Write application server code to implement events, shared business rules, shared data validation, and shared security. When writing this code, you may want to do the following:
  6. Save, compile, and register or install the application server.
  7. DataSnap using dbExpress does not require any runtime.
  8. If your server application uses TCP/IP sockets or HTTP connections, you must install the runtime software that receives client messages, instantiates the remote data module, and marshals interface calls.
    • For TCP/IP sockets this is a socket dispatcher application, Scktsrvr.exe.
    • For HTTP connections this is httpsrvr.dll, an ISAPI/NSAPI DLL that must be installed with your Web server.


See Also