You are not logged in.
The following implementation was created for accessing an interface in Mormot2 and it works without a problem from Windows using SynCrossPlatformREST from mormot1 using Delphi 11.1
function TwbService.mydbver(const dbver: Integer): utf8string;
var res: TVariantDynArray;
begin fClient.CallRemoteService(self,'mydbversionis',1,[dbver],res);
Result:=res[0]; end;
for a service defined as the following:
constructor TwbService.Create(aClient: TSQLRestClientURI);
begin
fServiceName:='wService';
fServiceURI:='wService';
fInstanceImplementation:=sicPerThread;
inherited Create(aClient);
end;
When compiled for Android I am getting the following error:
Overflow while converting variant of type (int64) into type (integer)
the problem seems to happen in line 2918 from SynCrossPlatformREST and commenting this line problem does not exist
outID := doc.Value['id'];
Am I missing something?
Offline
Isn't it a Delphi compiler problem?
doc.Value['id'] returns a variant - it could be converted into integer or Int64 at compilation time.
I don't have Delphi 11.1 so I can't comment. Perhaps some other users could.
Offline
I think the problem is that in
function CallGetResult(const aCall: TSQLRestURIParams; var outID: integer): variant;
outid is integer and the number it is returning is int64 causing overflow
{
"result": [
"{\"var1\":\"\",\"var2\":\"\"}"
],
"id": 140173798573824
}
Is the id above a 32bit integer?
Last edited by dcoun (2022-04-18 19:01:41)
Offline
You are right: the 64-bit values were not properly supported.
Please try with https://synopse.info/fossil/info/704c88beae
Offline
Thanks a lot @ab
Offline