英文:
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错误。以下是详细信息:
这里不需要身份验证
在本地使用Apex 22.1.0。http://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"}
英文:
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
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"}
答案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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论