REST数据源(OData)- 404:未找到

huangapple go评论52阅读模式
英文:

REST Data Source (OData) - 404: Not Found

问题

我已经按照ASP.NET Core OData 8入门创建了OData API,以下是浏览器返回的结果:

请求:http://localhost:5164/odata/pls/v1/Customers
响应:{"@odata.context":"http://localhost:5164/odata/pls/v1/$metadata#Customers","value":[{"Id":1,"Name":"Customer 1"},{"Id":2,"Name":"Customer 2"},{"Id":3,"Name":"Customer 3"}]}

请求:http://localhost:5164/odata/pls/v1/Customers(1)
响应:{"@odata.context":"http://localhost:5164/odata/pls/v1/$metadata#Customers/$entity","Id":1,"Name":"Customer 1"}

然后我按照Oracle ODATA Connector的指南添加了插件。在创建REST数据源时,按下“Discover”按钮会出现404错误。以下是详细信息:

REST数据源(OData)- 404:未找到

REST数据源(OData)- 404:未找到

REST数据源(OData)- 404:未找到

这里不需要身份验证

REST数据源(OData)- 404:未找到

在本地使用Apex 22.1.0http://localhost:5164已经添加到ACL中,并且可以成功访问http://localhost:5164/Login进行自定义登录。

请指导。

编辑1
这些是OData端点的结果

http://localhost:5164/odata/pls/v1/Customers

{"@odata.context":"http://localhost:5164/odata/pls/v1/$metadata#Customers","value":[{"Id":1,"Name":"Customer 1"},{"Id":2,"Name":"Customer 2"},{"Id":3,"Name":"Customer 3"}]}

http://localhost:5164/odata/pls/v1/Customers(2)

{"@odata.context":"http://localhost:5164/odata/pls/v1/$metadata#Customers/$entity","Id":2,"Name":"Customer 2"}

REST数据源(OData)- 404:未找到

英文:

I have created OData API following Getting Started with ASP.NET Core OData 8 and below are the results from browser

Request: http://localhost:5164/odata/pls/v1/Customers
Response: {"@odata.context":"http://localhost:5164/odata/pls/v1/$metadata#Customers","value":[{"Id":1,"Name":"Customer 1"},{"Id":2,"Name":"Customer 2"},{"Id":3,"Name":"Customer 3"}]}

Request: http://localhost:5164/odata/pls/v1/Customers(1)
Response: {"@odata.context":"http://localhost:5164/odata/pls/v1/$metadata#Customers/$entity","Id":1,"Name":"Customer 1"}

Then I followed Oracle ODATA Connector guideline to add the plugin. While creating REST Data Source, there is 404 error on pressing Discover button. Below are the details

REST数据源(OData)- 404:未找到

REST数据源(OData)- 404:未找到

REST数据源(OData)- 404:未找到

No Auth is required here
REST数据源(OData)- 404:未找到

Using Apex 22.1.0 locally. http://localhost:5164 is already added in ACL and http://localhost:5164/Login is being accessed successfully for custom login.

Please guide.

Edit 1
These are the results of the OData endpoint

http://localhost:5164/odata/pls/v1/Customers

{"@odata.context":"http://localhost:5164/odata/pls/v1/$metadata#Customers","value":[{"Id":1,"Name":"Customer 1"},{"Id":2,"Name":"Customer 2"},{"Id":3,"Name":"Customer 3"}]}

http://localhost:5164/odata/pls/v1/Customers(2)

{"@odata.context":"http://localhost:5164/odata/pls/v1/$metadata#Customers/$entity","Id":2,"Name":"Customer 2"}

REST数据源(OData)- 404:未找到

答案1

得分: 0

以下是关于“Remote Server”和“Settings”屏幕上的URL和路径错误的正确值。

Base URL(基本网址):http://localhost:5164/
URL Path Prefix(URL路径前缀):odata/pls/v1
Resource Path(资源路径):Customers

英文:

Urls and Paths were incorrect on Remote Server and Settings screens.
Below are the correct values against endpoint http://localhost:5164/odata/pls/v1/Customers

Base URL: http://localhost:5164/
URL Path Prefix: odata/pls/v1
Resource Path: Customers

huangapple
  • 本文由 发表于 2023年6月2日 14:44:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76387741.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定