I migrated a Datasnap server to XE 10.1 Berlin and now I get an error on the server when I invoke a servermethod with OUT parameters.
Object
TBtwlControlePar=class
xInDoc,
xHandmatig,
xStatus,
xVerwacht,
xAantal,
xVerwerkt,
xOnVerwerkt,
xOnverwerktInDocument,
xTotaalCustoms :Integer;
end;
function TPWAdminMethods.DOC_BTWAH_Get2(pPeriode, pMaand, pSort,pSelop,pSelOntvangen,pSelToegewezen,pSelVerwerkt: integer; pSel: string; out pControlePar: TBTWLControlePar): TResult;
ServerMethod
tmpM := TPWAdminMethodsClient.Create (DMForm.DSConnection.DBXConnection, false);
Client
FreeAndNil( fControlePar );
tmpResult := tmpM.DOC_VATLH_Get2(Jaar,sort,SelOp,SelOntvangen,SelToegewezen,SelVerwerkt,fSelection,fControlePar);
When this method is fired the server gives an error on this last line
procedure TDSMethod.Invoke(MethodInstance: TObject;
MethodValues: TDSMethodValues);
var
RContext: TRttiContext;
RType: TRttiType;
Params: TArrayOfTValue;
begin
Params := MethodValues.GetValues;
RType := RContext.GetType(MethodInstance.ClassType);
MethodValues.ReturnValue := RType.GetMethod(FMethodInfoHeader.NameFld.ToString).Invoke(MethodInstance, Params);
end;
Is it impossible to use out parameters in Delphi Berling Datasnap without the use of DBXJson?

outparameter to a pointer and do the conversion. After the conversion toTObject, do anisto check it's really the class you need it to be and then you can safely hardcast it toTBtwlControlePar- Johan