No data is load to XDataWebDataSet in Vcl or Web project
procedure TForm1.btnLoadClientEntityClick(Sender: TObject);
begin
rsClients2.Connection:= WebConn;
rsClients2.Close;
dgrClients.DataSource:= dsClients2;
rsClients2.Open;
end;
the URL is set to: http://localhost:2001/
WebConn is connected to Server
rsClients EntitySetName is: client
When got to browser, SwaggerUI is there and i can query client and its working.
http://localhost:2001/client ? all client are loaded
Whats wrong? is not working. Structure is loaded but no data in rsClients2.
wlandgraf
(Wagner Landgraf)
April 28, 2026, 6:55pm
2
Please refer to the documentation, you should use Load, not Open, to automatically retrieve data from the server. There are also several demos in XData showing how to do it.
Hello, I've already tried Load, but it didn't work. Nothing works with EntitySetName, but my service calls work in VCL but not on the web. It seems that nothing works on the web and debugging is very slow.
wlandgraf
(Wagner Landgraf)
April 28, 2026, 9:26pm
4
Please provide steps or demo to reproduce the problem. This is basic usage and there are several demos showing it working, so you should try them and let us know what and how your code differs from them.
That work on VCL
procedure TForm1.LoadClients;
var
LClient: TXDataClient;
LService: IMyService;
LStream: TMemoryStream;
begin
LClient:= TXDataClient.Create;
LClient.Uri:= C_WEB_URL;
LService:= LClient.Service < IMyService>;
LStream:= TMemoryStream.Create;
try
LStream:= LService.GetClients as TMemoryStream;
LStream.Position:=0;
dgrClients.DataSource:= dsClients1;
FDMemTable1.LoadFromStream(LStream,sfJSON);
finally
FreeAndNil(LStream);
end;
end;
That not work on WEB
procedure TForm1.LoadClients(AConn: TXDataWebConnection; ADataSet: TXDataWebDataSet);
var
Client: TXDataWebClient;
Response: TXDataClientResponse;
begin
try
Client:= TXDataWebClient.Create(nil);
Client.Connection:=AConn;
Response:= await(Client.RawInvokeAsync('IMyService.GetClients',[]));
ADataSet.Close;
dsClients.DataSet:= ADataSet;
ADataSet.SetJsonData(Response.Result);
ADataSet.Open;
finally
FreeAndNil(Client);
end;
end;
wlandgraf
(Wagner Landgraf)
April 29, 2026, 8:50pm
6
Try to understand better your application.
Check the network requests in the browser tab to see if you see something wrong there.
Check the browser console to see if some error is being raised.
Log to the console some of your data (like Response and Response.Result) to see if you are properly receiving/handle data as you expect.
Or, send us project/steps to reproduce the problem.