Visual Builder

Get Involved. Join the Conversation.

Topic

    Jeffrey Kemp
    No data from REST endpoint
    Topic posted August 28, 2019 by Jeffrey KempGreen Ribbon: 100+ Points, last edited August 29, 2019, tagged REST 
    61 Views, 11 Comments
    Title:
    No data from REST endpoint
    Summary:
    Unable to use REST endpoint - no data retrieved
    Content:

    I've defined my REST endpoint under Service Connections which is pointing to an Auto-REST enabled table. I can GET, POST, PUT and DELETE records using the service.

    When I try to add a table to a page and select the GET endpoint as the data source, the wizard warns that the endpoint "Does not contain any suitable Objects". When I add it anyway, the table shows the attributes from the table but no data (although there is data in the table).

    At runtime the console log shows the error:

    TypeError: Failed to fetch
    The FetchEvent for "https://<redacted>/ords/pdb1/vb_app/po_request/" resulted in a network error response: the promise was rejected.
    Promise.then (async)
    (anonymous) @ vbServiceWorker.js?jetPath=https://static.oracle.com/cdn/jet/v6.1.2/&modulePath=https://static.oracle.com/cdn/vb/v19.1.3.7/&nonce=xkrr3nzmy:145
    vbServiceWorker.js?jetPath=https://static.oracle.com/cdn/jet/v6.1.2/&modulePath=https://static.oracle.com/cdn/vb/v19.1.3.7/&nonce=xkrr3nzmy:1 Uncaught (in promise) TypeError: Failed to fetch

    Image:

    Comment

     

    • Shay Shmeltzer

      Which security/authentication did you set on the service?

      Did it work when you did the test step in the endpoint definition? 

      Do you have a sample of the data structure returned in the test step?

      • Jeffrey Kemp

        Hi Shay,

        No authentication has been applied.

        It works in the test step when defining the endpoint.

        Yes, it returns an array of items, it's an autorest enabled table. I can put a sample here tomorrow when I go to the office.

        Thanks,

        Jeff

        • Shay Shmeltzer

          Try setting the authentication setting of the service to enable -> None (Use Proxy) and see if it helps.

           

          • Jeffrey Kemp

            Strange thing - first time I opened the page this morning it worked. I hadn't changed anything.

            After a short time building a page, the problem re-occurred - "no data to display".

            I tried switching authentication to enabled - None (Use Proxy) but that resulted in authentication failures.

            I tried switching it off, and now even the Test mode doesn't work, resulting in Network Error (ERR_CERT_AUTHORITY_INVALID).

            So I've returned it all to the original configuration and now nothing works in VB...

            Postman still works regardless.

    • Shay Shmeltzer
      If you look at the network tab of the browser Dev tools, what error do you see when you test the service from VB?
    • Jeffrey Kemp

      I was getting the ERR_CERT_AUTHORITY_INVALID error.

      I disabled REST for the table and the schema, and re-enabled with a different alias for both. I've created a whole new application and added a new Service Connection, and the Test of the "get" works. Response attached.

      I've added an application page with a table based on the rest endpoint, and it still shows "No data to display" with the following error in the console:

      TypeError: Failed to fetch
      The FetchEvent for "https://<redacted>/ords/pdb1/vbapp/porequest/" resulted in a network error response: the promise was rejected.
      Promise.then (async)
      (anonymous) @ vbServiceWorker.js?jetPath=https://static.oracle.com/cdn/jet/v6.1.2/&modulePath=https://static.oracle.com/cdn/vb/v19.1.3.7/&nonce=y1nvkxgir:145
      vbServiceWorker.js?jetPath=https://static.oracle.com/cdn/jet/v6.1.2/&modulePath=https://static.oracle.com/cdn/vb/v19.1.3.7/&nonce=y1nvkxgir:1 Uncaught (in promise) TypeError: Failed to fetch
      rest.js:327 GET https://<redacted>/ords/pdb1/vbapp/porequest/ net::ERR_FAILED
      (anonymous) @ rest.js:327