Hi
Another small question.
This is my implementation method at server:
[ROService(__ServiceName, __ServiceID)]
TautenticacaoService = class(TRORemoteDataModule)
public
[ROServiceMethod]
function Login(const aUserID: Unicodestring; const interfaces: array of string ): Unicodestring;
This is what RO generated:
IautenticacaoService = interface(IROService)
['{54485C27-740F-4C83-B73B-0783EDAF86D9}']
function Login(const aUserID: UnicodeString; const interfaces: UnicodeString): UnicodeString;
end;
Note that it translated array of string
into unicodeString
This is my client code (or how I want to send it to server):
...
FConexaoAutenticacao.Login('MARCOS',[EID_LogEvents]);
...
It complains that ‘ordinal type required’, so How can I send and array of string to server?
EvgenyK
(Evgeny Karpov)
December 17, 2024, 6:13am
2
Hi,
You can use TArray<UnicodeString>
note: You can launch Service Builder (Windows) and generate files in it. it can be helpful:
Hi
When I use TArray:
[ROService(__ServiceName, __ServiceID)]
TautenticacaoService = class(TRORemoteDataModule)
procedure RORemoteDataModuleCreate(Sender: TObject);
private
public
[ROServiceMethod]
function Login(const aUserID: Unicodestring; const interfaces: TArray<UnicodeString> ): Unicodestring;
It generates:
IautenticacaoService = interface(IROService)
['{54485C27-740F-4C83-B73B-0783EDAF86D9}']
function Login(const aUserID: UnicodeString; const interfaces: TArray_System_string_): UnicodeString;
Which does not compile as it doesn’t know this type TArray_System_string_
I know how to solve it in a hard way: declare a type of array of string as a TROComplexType and so on but I think I am doing some mistake here and there is a simple way to do that…
EvgenyK
(Evgeny Karpov)
December 17, 2024, 1:09pm
4
Hi,
EvgenyK:
You can use TArray
sorry, correct one is TROArray<UnicodeString>
.
SB generates this case as
MyStringArray = class(TROArray<UnicodeString>)
end;
INewService = interface(IROService)
['{59acf55f-ee19-4ddf-a5a4-203a237906ef}']
procedure NewMethod(const NewParam: MyStringArray);
end;