Skip to Main Content

ORDS, SODA & JSON in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can we configure ORDS to allow cross origin resource sharing for the PL/SQL gateway functionalit

user11978485Sep 15 2016 — edited Jun 1 2017

We are using ORDS to provide the PL/SQL gateway facilities that used to be provided by mod_plsql. But ORDS has to be deployed to a different domain from the web page that wants to invoke the PL/SQL function via a POST command. We are using a Chrome browser, and it is unable to access the PL/SQL via ORDS because it does not have cross origin resource sharing set to allow it.

I've found in the document "ORDS Installation, Configuration, and Development Guide" the PL/SQL function ORDS.SET_MODULE_ORIGINS_ALLOWED, which looks like it might do the job, but if we have to use that, what module do we specify to set the origins of? We have not created any ORDS modules ourselves, and we are not using APEX, we are just using the default PL/SQL Gateway setup. The ORDS PL/SQL Package Reference does not seem to specify any way to list the modules. I found a table called ORDS_MODULES in the database (in an ords metadata schema), but it seems to be empty so that didn't help. Maybe there isn't a module in our scenario - but in that case how do we specify allowed origins?

This is ORDS version 3.0.6. Strangely enough the problem doesn't happen in version 3.0.2. Maybe that older version just ignores CORS altogether, which I suppose would have been a deficiency, but 3.0.6 is only an improvement if we can find the way to specify the allowed origins. We obviously can't afford to be stuck on version 3.0.2 for ever.

In case it matters ORDS is deployed on a Weblogic 10.3.6 server. (I've seen another thread in which someone had a problem with CORS when deployed on Apache and Tomcat which required a change to their configuration too, so I suppose the same might be true of weblogic, but haven't been able to find anything about it - and the ORDS Installation, Configuration, and Development Guide section C.8.6 about CORS seems to be just saying that it is an ORDS configuration matter.)

Comments

360 / 5000
Hello, I had the same problem trying to get or send data from a text field of type display only or sometimes even with those of type read only, the solution I could find is to create a text field of type hidden to send or get data and use the others only for samples. I don't understand why he behaves that way either, but I hope it helps you with something.

Meeuwtje

Hi Christian,
Thank you for your response.
The only workaround we have at the moment is to change the display-only column to a text field column and add a custom class APP-readonly in the Appearance CSS Classes attribute and the Advanced CSS Classes attribute. This class will add the readonly="readonly" attribute to the element on loading the page and uses some CSS (background) to make the column look like a display only column.
$(".APP-readonly").attr("readonly","readonly");
.a-GV-table tr:nth-child(odd) .a-GV-cell.WES-readonly {background-color: #dfe0e0;}
.a-GV-table tr:nth-child(even) .a-GV-cell.WES-readonly {background-color: #cccece;}
It is a bit more work sadly enough instead of just using the display only type, but it makes it possible to copy the readonly text by the user

1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 29 2017
Added on Sep 15 2016
8 comments
35,488 views