Exposing DataSnap Server Methods

From Appmethod Topics
Jump to: navigation, search

Go Up to DataSnap Server Application


Server methods in DataSnap are allowed in descendents of TPersistent, TDataModule and TDSServerModule. In order to have server methods in a module, only the two latter are accepted. You can choose to use the DataSnap Server wizard or you can create server methods using either File > New > Other > Object Pascal Projects > DataSnap Server > Server Module, or File > New > Other > Object Pascal Projects > Object Pascal Files > Data Module. TDataModule requires you to publish the methods by adding the Object Pascal compiler directive {$METHODINFO ON/OFF} around the class definition.

Server methods in DataSnap are allowed in descendents of TPersistent and TDataModule. In order to have server methods in a module, only the latter one is accepted. You can choose to use the DataSnap REST Application Wizard or you can create server methods using File > New > Other > Object Pascal Projects > Object Pascal Files > Data Module. TDataModule requires you to publish the methods by adding the Object Pascal compiler directive {$METHODINFO ON/OFF} around the class definition.

The module contains published methods that can be remotely invoked, but not all the parameter types are supported. The supported types are:

Both procedure and functions are supported, as well as out and var parameters.

Note: Overloaded methods are not supported.

See Also