You create an application server very much as you create most database applications. The major difference is that the application server uses a remote data module.
To create an application server
- Start a new project:
- If you are using SOAP as a transport protocol, this should be a new Web Service application. Choose FileNewOther, and on the WebServices page of the new items dialog, choose SOAP Server application. Select the type of Web Server you want to use, and when prompted whether you want to define a new interface for the SOAP module, say no.
- For any other transport protocol, you need only choose FileNewApplication. Save the new project.
- Add a new remote data module to the project. From the main menu, choose FileNewOther, and on the ActiveX, Delphi Files, or WebServices page of the new items dialog, select
- Place the appropriate dataset components on the data module and set them up to access the database server.
- 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.
- Write application server code to implement events, shared business rules, shared data validation, and shared security. When writing this code, you may want to
- Save, compile, and register or install the application server.
- If your server application does not use DCOM or SOAP, 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.