I'd like to add another voice to Guido's post...
If I have an XDataWebDataset dropped on a form, and then create fields at design time, and then try to populate it with the SetJsonData function, it works.
If I instead create the fields for the same control using FieldDefs at runtime, it seems to think it still needs the EntitySetName set and thus fails.
I think what he's trying to do (and what I'm trying to do) is to have a local TDataset that contains the records coming from something like an FDQuery on the server, without using the Entity mechanism but rather a service call. And as we can't use a local TFDMemTable (for reasons that are not clear to me), the XDataWebDataset seems the closest thing, particularly with the SetJsonData function beign availabe. But for this to work we need to be able to define the fields at runtime and do everything else without actually using the connectivity aspects of the XDataWebDataset in this instance as we're supplying the data after having gotten it (manually) via Json previously.
If there is a dummy field added at runtime then the error is different (can't find matching fields) so presumably there's a problem in XDataWebDataset's handling of FieldDefs. Maybe they're just not iimplemented?
Perhaps I can writeup an issue that more clearly shows the process from having an FDQuery dump data into a TStream on an XData endpoint and then having it recreated locally so it can be used in a local WebDBGrid or available in the usual TDataSet First/Next kind of mechanism. With the TStream and its JSON contents being used as a simple communications mechanism without having to pay much attention to how it works.