Search code examples
oracle-apex

REST Data Source (OData) - 404: Not Found


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

enter image description here

enter image description here

enter image description here

No Auth is required here enter image description here

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"}

enter image description here


Solution

  • 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