Exposing DataSnap Server Methods
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 > Delphi Projects > DataSnap Server > Server Module, or File > New > Other > Delphi Projects > Delphi Files > Data Module.
TDataModule requires you to publish the methods by adding the Delphi 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:
- Boolean
- SmallInt
- Integer
- Int64
- Single
- Double
- AnsiString
- String
- TDBXTime
- TDBXDate
- TJSONValue and all descendents
- TDBXWideStringValue
- TDBXAnsiStringValue
- TDBXUInt8Value
- TDBXInt8Value
- TDBXInt16Value
- TDBXInt32Value
- TDBXInt64Value
- TDBXSingleValue
- TDBXDoubleValue
- TDBXBcdValue
- TDBXTimeValue
- TDBXDateValue
- TDBXTimeStampValue
- TDBXBooleanValue
- TDBXReaderValue
- TDBXStreamValue
Both procedure and functions are supported, as well as out and var parameters.
Note: Overloaded methods are not supported.