I have installed Oracle Database 23c on OEL along with Oracle APEX on a compute instance. Using Oracle APEX, I have AutoREST enabled a view for a GET Operation. I can run the REST URL through POSTMAN (GET Operation) or VSCode REST Client without any issues.
However, when I use Oracle APEX PL/SQL to call this REST API, it throws the ORA-29273: HTTP request failed error. Please advise on how to resolve this.
Test Case
- 158.101.x.y is the public IP address of Compute Instance.
- my23cdbhostname.sub03161254111.indvcn.oraclevcn.com is Hostname
- Port 8080 is Open
- Server is running on cloud over HTTP and no HTTPS.
Case 1: Tested thought VSCode REST Thunder Client
http://158.101.x.y:8080/ords/graphuser/driver_dv/ (This works)
Case 2: Tested using Postman Web or just web browser like Chrome
http://158.101.x.y:8080/ords/graphuser/driver_dv/ (This works)
Case 3: Terminal window of iMac
curl -i -H "Content-Type: application/json" -X GET "http://158.101.x.y:8080/ords/graphuser/driver_dv/"
(This works)
The below cases does not work.
Using Oracle APEX Navigation → Oracle APEX -> SQL Workshop -> SQL Commands
Case 4:
SELECT UTL_HTTP.REQUEST(url => 'http://158.101.x.y:8080/ords/graphuser/driver_dv') FROM dual;
ORA-29273: HTTP request failed
Case 5:
SELECT UTL_HTTP.REQUEST(url => 'http://my23cdbhostname.sub03161254111.indvcn.oraclevcn.com:8080/ords/graphuser/driver_dv/') FROM dual;
ORA-29273: HTTP request failed
Case 6:
declare
l_rest_url varchar2(1000) := 'http://158.101.x.y:8080/ords/graphuser/driver_dv';
l_body varchar2(32000) ;
begin
apex_web_service.g_request_headers.DELETE;
apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).value := 'application/json';
l_body := apex_web_service.make_rest_request(
p_url => l_rest_url,
p_http_method => 'GET'
);
end;
Error Message
RA-29273: HTTP request failed
ORA-06512: at "APEX_230100.WWV_FLOW_WEB_SERVICES", line 1325
ORA-06512: at "APEX_230100.WWV_FLOW_WEB_SERVICES", line 897
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SYS.UTL_HTTP", line 380
ORA-06512: at "SYS.UTL_HTTP", line 1189
Case 7: How to access REST API running on Oracle Database 23c from Oracle APEX Instance running on Oracle Autonomous Database?
Kindly Advise, how to resolve this.