Hi,
I am trying to get an XData console application with Aurelius database connection running,
but when I am calling the URL of a database table published by XData Server in m browser
I am getting an AccessViolation exception.
First of all, it should be said, that I my XData service application in principle is running.
I have also created a client which is able to get data which I am requesting from the server
via JSON objects.
So, for debugging purposes I made a new "TMS XData Server Application" with the wizard,
as descibed in the tutorial of Holger Flick, and selected "console" application.
I used the default server settings (http://+:2001/tms/data) and selected Native SQLite
(my real application uses MSSQL, but for testing it's easier using this type of database,
and I also got the error with MSSQL).
After the wizard created the application I only made two changes:
-
"In ConnectionModule.pas" -> "AureliusConnection1" -> "Connection settings"
I selected the database file which I have created before. It only contains one table "Users".
with two fields, while one of the fields is also the primary index. "Test Connection" said
"Connection established successfully". -
I generated the entities for the database with the assistant and selected my "Users" table.
Now I compiled the project and started the server, which is working as expected.
So I opened my browser and the URL http://localhost:2001/tms/xdata/$model to see whether my
XData server is publishing the database objects. The $model looked as expected: my database
table and both of the fields of the table are visible.
But when I am calling http://localhost:2001/tms/xdata/Users (where "Users" is the name of
the table as shown in the $model) I am getting back this error message:
{
"error": {
"code": "AccessViolation",
"message": "Zugriffsverletzung bei Adresse 00601534 in Modul 'Console_XData_Server.exe'. Lesen von Adresse 00000068"
}
}
Do you have any ideas what's going wrong?
I am using Delphi 10.4.2 Sydney and TMS with latest patches.
Here is the result of $model:
{
"Title": "Server API",
"Version": "3",
"Schemas": [
{
"Namespace": "XData.Default",
"EntityTypes": [
{
"Name": "Users",
"Properties": [
{
"Name": "UserID",
"Required": true,
"Length": 3,
"Type": "String"
},
{
"Name": "UserFullname",
"Length": 50,
"Type": "String"
}
],
"NavigationProperties": [],
"Key": [
"UserID"
]
}
],
"EntityContainers": [
{
"Name": "Default",
"EntitySets": [
{
"Name": "Users",
"EntityType": "Users"
}
]
}
],
"EnumTypes": [],
"InstanceTypes": [],
"Controllers": []
}
]
}
Best regards,
Falko