You are not logged in.
This is modified from the sample.
api.interfaces.pas
------------------------------------
TProcessingResult = packed record
ServerSyncTime: TDateTime;
Msg: RawUtf8 ;
ResultStatus:RawUtf8;
ServerSyncVersion:RawUtf8;
FailedTableNames: TArray<string>;
end;
TSyncDataItem = packed record
ID: TID;
TriggerType:RawUtf8;
TableName: RawUtf8;
OperType: Integer;
SyncVersion: RawUtf8;
SyncTime: TDateTime;
DeleteFlag: Boolean;
FieldValues: TJSONObject;
end;
PSyncDataItem=^TSyncDataItem;
TSyncDataItems = array of TSyncDataItem;
ILongWorkService = interface (IInvokable)
['{09FDFCEF-86E5-4077-80D8-661801A9224A}']
function SyncData (const items:TSyncDataItems): TProcessingResult; // 简化参数名称,避免冲突
end;
....
initialization
Rtti.RegisterFromText(TypeInfo(TProcessingResult),
'ServerSyncTime:TDateTime Msg:RawUtf8 ResultStatus:RawUtf8 ServerSyncVersion:RawUtf8 FailedTableNames: TArray<string>');
Rtti.RegisterFromText(TypeInfo(TSyncDataItem),
'id:TID TriggerType:RawUtf8 TableName:RawUtf8 OperType:Integer SyncVersion:RawUtf8 ' +
'SyncTime:TDateTime DeleteFlag:Boolean FieldValues:TJSONObject');
Rtti.RegisterType(TypeInfo(TSyncDataItems));
TInterfaceFactory.RegisterInterfaces( [TypeInfo(ILongWorkCallback) , TypeInfo(ILongWorkService)] ) ;
Server Side:
---------------------------
function SyncData(const items:TSyncDataItems): TProcessingResult;
begin
result:=ExecuteDataOperation(items);
end;
Client Side:
----------------------------
for J := 0 to 2 do
begin
SetLength(Test, Length(Test) + 1);
Test[High(Test)] := SyncDataItems[J];
end;
SyncResponse :=FClient.Service.SyncData(Test) ;
An error occurs when the client invokes the method: it works fine when the Test array has 2 elements, but throws an error when it has 3 elements. I don’t know the reason—could it be that there is a limit on parameter passing? and this error occurs before the parameters are transmitted to the server program
Offline
There is no such limitation.
See the regression tests.
Which error do you have?
As stated by the forum rules, a minimum reproducible example in a gist is better to understand what is occurring.
Such limited code in the thread is almost pointless.
Online
ok, thanks.
i've found the issue, there is no limitaion.
Offline