Using Nonscalar Types in Invokable Interfaces
Go Up to Understanding Invokable Interfaces
The Web Services architecture supports the following scalar types for both Delphi and C++:
Boolean |
ByteBool |
WordBool |
LongBool |
Char |
Byte |
ShortInt |
SmallInt |
Word |
Integer |
Cardinal |
LongInt |
Int64 |
Single |
Double |
Extended |
string |
WideString |
Currency |
TDateTime |
Variant |
The following additional scalar types are supported for C++:
bool |
unsigned short |
_int64 |
char |
int |
AnsiString |
signed char |
unsigned |
float |
unsigned char |
long |
double |
short |
unsigned long |
long double |
You need not do anything special when you use these scalar types on an invokable interface. If your interface includes any properties or methods that use other types, however, your application must register those types with the remotable type registry.
Dynamic arrays can be used in invokable interfaces. They must be registered with the remotable type registry, but this registration happens automatically when you register the interface. The remotable type registry extracts all the information it needs from the type information that the compiler generates.
Enumerated types and types that map directly to one of the automatically-marshaled scalar types can also be used in an invokable interface. As with dynamic array types, they are automatically registered with the remotable type registry.
For any other types, such as static arrays, structs or records, sets, interfaces, or classes, you must map the type to a remotable class. A remotable class is a class that includes runtime type information (RTTI). Your interface must then use the remotable class instead of the corresponding static array, struct or record, set, interface, or class. Any remotable classes you create must be registered with the remotable type registry. As with other types, this registration happens automatically.