We have a problem with Datasnap RESTfull, it seem to have an incompatibility between 10.3 Rio and 10.2 Tokyo (and all bellow) about Datasnap RESTfull function implementation.
The problem:
We have a server, builded with 10.2 currently running and servicing a lot of users. If we update the server with the one compiled with Delphi 10.3 Rio, the current 10.2 client (Win, MacOS, iOS, Android) receive the following error message: Internal: Field FValue cannot be found in type TJSONString.
Conversly, when we try the client compiled with Delphi 10.3 Rio thru the current server (10.2) running on Amazon AWS, we got the following error message: Internal: Field FStrBuffer cannot be found in type TJSONString.
The only way to have working system, is to use the 10.3 client with 10.3 server. But, currently, there is a lot of user then we cannot change the server part and expect to have all client (desktop and mobile) to be updated at the same time.
The code on the server :
function TServerMethods1.GetMembers: TFDJSONDataSets;
begin
sCurrentDBName := aDBName;
FDQueryMEMBERS.Close;
Result := TFDJSONDataSets.Create;
TFDJSONDataSetsWriter.ListAdd(Result, StrMEMBERS, FDQueryMembers);
end;
The code on the client :
procedure TMemberServer.GetMembers;
var
aDataSetLists: TFDJSONDataSets;
begin
aDataSetLists := ServerMethods.GetMembers(sDBName);
FDMemTableMembers.Active := false;
FDMemTableMembers.AppendData(TFDJSONDataSetsReader.GetListValue(aDataSetLists, 0));
end;
Investigation:
In the 10.3 version of System.JSON
, FValue
is implemented but not FStrBuffer
.
In the 10.2 version of System.JSON
, FStrBuffer
is implemented but not FValue
.
Question:
What can we do the keep the current 10.2 user working and also being able to update the server with 10.3 Rio?
Is there another way to implement this function or is there a workaround ?