DataSnap.Basic DataSnap Client and Server Sample
This sample shows how to create a DataSnap Server and a DataSnap Client.
Location
You can find the Basic DataSnap Client and Server Sample sample project at:
- Start | Programs | Embarcadero RAD Studio Sydney | Samples and then navigate to Object Pascal\DataSnap\Basic.
- Subversion Repository:
- You can find Delphi code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.
Contents
Description
The Basic DataSnap Client and Server application demonstrates:
- How to create a DataSnap Server application.
- How to create a DataSnap Client application.
How to Use the Sample
There are three projects in subdirectories of the Basic directory:
Server Project
- Navigate to Start | Programs | Embarcadero RAD Studio Sydney | Samples and go to Object Pascal\DataSnap\Basic\Server.
- Open the DataSnapTestServer.dproj project.
- Build the DataSnapTestServer.dproj project.
- Run the application by clicking Run > Run in the IDE or by pressing F9.
- The Server's interface shows you an Event Log and an Active Connections chart. These auto-populate when the Client attempts to connect to the Server.
Client Project
- Navigate to Start | Programs | Embarcadero RAD Studio Sydney | Samples and go to Object Pascal\DataSnap\Basic\Client.
- Open the DataSnapTestClient.dproj project.
- Build the DataSnapTestClient.dproj project.
- Run the application by clicking Run > Run in the IDE or by pressing F9.
- The Client application enables you to test the server method class, the server method component, and the provider.
DataSnap Server Methods Example Project
This client application is a collection of dunit tests. These are not rigorous tests. They provide easy to read examples of how to use DataSnap features.
The server and client are included in this project. Normally these would be in separate projects and executed in separate processes. The client and server are combined into the same project and execute in the same process for the purpose of providing a simple example. Units that would normally execute in a server process have Server in their name. Units that would normally execute in a client process have Client in their name.
- Navigate to Start | Programs | Embarcadero RAD Studio Sydney | Samples and go to Object Pascal\DataSnap\Basic\Examples.
- Open the DataSnapExamples.dproj project inside the same project group as the Server.
- Build the DataSnapExamples.dproj project.
- Run the application by clicking Run > Run in the IDE or by pressing F9. Make sure you have the DataSnapExamples.dproj project selected in the Project Group.
Files
The files used by this sample are:
Server Files
File | Contains |
---|---|
DataSnapTestServer |
The Basic DataSnap Server project. |
MethodsServerModule |
The DataSnap Server module. |
ParametersServerModule |
The parameters Server module. |
ProviderServerModule |
The provider Server module. |
ServerContainerForm |
The main form that is the user interface for the Basic DataSnap Server application. |
Client Files
File | Contains |
---|---|
ClientClasses |
Client classes created by the DataSnap proxy generator. |
ClientForm |
The main form that is the user interface for the Basic DataSnap Client application. |
DataSnapTestClient |
The Basic DataSnap Client project. |
DataSnap Server Methods Example Files
File | Contains |
---|---|
This client is a collection of dunit tests. |
Client classes created by the DataSnap proxy generator. |
ClientTestClasses |
Client test classes created by the DataSnap proxy generator. |
DataSnapExamples |
The Basic DataSnap Server Methods Example project. |
DataSnapTestData |
Various methods and classes used in the testing process. |
TestServerContainer |
The DataSnap server container. |
TestServerModule |
The DataSnap server module. |