NotGaeL
NotGaeL

Reputation: 8484

Parse APEX RESTful WebService reference JSON response stored in CLOB001 column

I am trying to generate a report page in my APEX application, using the data obtained from a REST service response.

I added a new RESTful webservice reference and sepecified a JSON output.

Then I've generated a query/report page, but this is what's being currently displayed:

enter image description here

Instead I want the report to display the contents of data field on the JSON response (A single row with various columns and values)

Is there any straight forward way to show each response element and field on its row and column instead of a single column and row with the whole response, like there is with XML RESTful responses?

Upvotes: 0

Views: 1514

Answers (1)

Tom
Tom

Reputation: 7028

Consider whether another output type may be more handy. If you're putting out JSON and expect to handle it in PLSQL, then you do need to realize that PLSQL does not handle that natively.

Want to handle the rest response as json in plsql? Then look into some PLSQL libraries/projects that may do this:

Then print out the returned HTML through HTP.P calls. Though honestly, if you want to stick with plsql you would be much better off using XML as a return type, since you can then use all the xml goodies in the database. Though simply spitting out some html structure may not be quite too interesting (but I digress).

Or call the rest service through an ajax call from javascript, and handle the object there. After all, JSON is Javascript Object Notation and should be perfect for javascript, right? Then simply inject your html somewhere in the document. Ideally you would set up a region as a container for this.

Upvotes: 2

Related Questions