简体   繁体   中英

Error when using OUT parameters in datasnap servermethod

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;

VAN和OUT参数必须完全匹配参数类型

Is it impossible to use out parameters in Delphi Berling Datasnap without the use of DBXJson?

This error message and the issue has been logged on Embarcadero's Quality Portal as RSP-14895. This was on 16May16 by someone else. That person stated "XE10 is OK". Today (14Jun16) I added another test project to the issue. My test project is for the case of a VAR parameter. I have also provided a screenshot of the test project in action. My tests work on XE6 but fail on 10.1 Berlin. I can't use DataSnap until this issue is fixed. Please vote up the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM