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!

CORS error when calling DELETE or PUT against apex.oracle.com

This issue seems like out would be simple fix by enabling CORS on the apex.oracle.com service, but there is something else going on.

Hitting my REST endpoints from Postman work just fine.  DELETE and PUT (Update) included.  However when I call them from my JavaScript application, I get the CORS error.

The SQL looks like this

  ORDS.define_handler(

    p_module_name    => 'testmodule3',

    p_pattern        => '.',

    p_method         => 'DELETE',

    p_source_type    => ORDS.source_type_plsql,

    p_source         => 'BEGIN

                           remove_employee(p_empno => :empno);

                         END;',

    p_items_per_page => 0);

and the stored procedure looks like:

create or replace PROCEDURE remove_employee (

  p_empno  IN  emp.empno%TYPE

)

AS

BEGIN

  DELETE FROM emp WHERE empno = p_empno;

EXCEPTION

  WHEN OTHERS THEN

    HTP.print(SQLERRM);

END;

Here is the full error message.  The endpoint is in there if you want to try and hit it.

Failed to load https://apex.oracle.com/pls/apex/oraclejet/emp//553: Method DELETE is not allowed by Access-Control-Allow-Methods in preflight response.

If I had access to the server, I would check my servlet filters, but this is all from apex.oracle.com.

Thanks for any thoughts or pointers.

--jb

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 8 2018
Added on Jan 11 2018
0 comments
392 views