I've been trying to get Oracle to call a REST API. While getting things set up and running we ran into an issue where our code generates an ORA-53203: security violation. In the process of isolating the issue we set up a procedure to test the connection and this, too, generates the same error.
We are using Oracle 12c and we've set up ACE/ACL entries for the host we're testing with for both 'connect' and 'resolve' permissions.
create or replace procedure showTitleTag ( i_url in varchar2 )AS l_httpreq UTL_HTTP.req; l_httpresp UTL_HTTP.resp; l_text varchar2(32767); l_response CLOB; l_title varchar2(32767);BEGIN l_httpreq := UTL_HTTP.begin_request(i_url); l_httpresp := UTL_HTTP.get_response(l_httpreq); BEGIN LOOP UTL_HTTP.read_text(l_httpresp, l_text, 32766); l_response := l_response || l_text; END LOOP; EXCEPTION WHEN UTL_HTTP.end_of_body THEN UTL_HTTP.end_response(l_httpresp); END; l_title := REGEXP_REPLACE(l_response, '.*<title> ?(.+) ?</title>.*', '\1', 1, 1, 'in'); DBMS_OUTPUT.put_line(l_title);EXCEPTION WHEN OTHERS THEN UTL_HTTP.end_response(l_httpresp); RAISE;END;
This code, should give us the contents of the web-page's title tag (we used "http://www.redhat.com" as our test URL). Instead we receive the following errors:
ORA-29273: HTTP request failedORA-53203: security violationORA-06512: at "APPS.SHOWTITLETAG", line 29ORA-06512: at line 1