When invoking service operations with RawInvoke
, you should manually set the data to the dataset:
Here is a small example:
And here is a more detailed explanation:
Basically:
- Use
TXDataWebClient
to retrieve data from the server directly using more flexible methods (likeList
).TXDataWebClient
also provides you withasync
-flagged methods, meaning you can call them usingawait
. There is a demo in XData installation folder (\demos\web\clientAsync
) that shows how to use it. Once you get data from the client, you can put it in the dataset usingSetJsonData
and then you can callOpen
to iterate through the dataset.
procedure TfClientDatamodul.LoadOrders;
procedure OnSuccess(Response: TXDataClientResponse);
begin
XDataWebDataSetOrders.Close;
//XDataWebDataSetOrders.Connection:=NIL;
//XDataWebDataSetOrders.EntitySetName:='';
XDataWebDataSetOrders.SetJsonData(Response.Result);
XDataWebDataSetOrders.Open;
end;
begin
XDataWebClientOrders.RawInvoke('IOrderService.GetOrders', ['10/10/2018', '10/10/2019'], @OnSuccess);
end;