Я настроил ACL с помощью пакета DBMS_NETWORK_ACL_ADMIN. Вот это

Но когда я пытаюсь подключиться к вышеуказанному веб-сервису с помощью GET, я получаю ошибку
ORA-29273: HTTP request failed
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SYS.UTL_HTTP", line 368
ORA-06512: at "SYS.UTL_HTTP", line 1118
ORA-06512: at "APEX_040200.WWV_FLOW_WEB_SERVICES", line 550
ORA-06512: at "APEX_040200.WWV_FLOW_WEBSERVICES_API", line 197
ORA-06512: at line 7
29273. 00000 - "HTTP request failed"
*Cause: The UTL_HTTP package failed to execute the HTTP request.
*Action: Use get_detailed_sqlerrm to check the detailed error message.
Fix the error and retry the HTTP request.
Я также хотел бы отметить, что хост oracle-base.com работает отлично. приведенный ниже код работает нормально.
declare
l_response CLOB;
l_url varchar2(4000) := 'http://oracle-base.com/webservices/add-numbers.php'; --web service URL
l_result NUMBER;
begin
---get XML from
l_response := apex_web_service.make_rest_request(p_url => l_url,
p_http_method => 'GET',
p_parm_name => apex_util.string_to_table('p_int_1:p_int_2'),
p_parm_value => apex_util.string_to_table('12:12')
);
dbms_output.put_line(l_response);
--parse the response
l_result :=apex_web_service.parse_xml(p_xml => XMLTYPE(l_response), --convert CLOB to XML
p_xpath => '//number/text()'
);
dbms_output.put_line(l_result);
end;
, но когда я пытаюсь сделать то же самое для reqres.in, он терпит неудачу. Как я добавил reqres.in
DECLARE
l_principal VARCHAR2(20) := 'APEX_040200';
--l_principal VARCHAR2(20) := 'APEX_050000';
--l_principal VARCHAR2(20) := 'APEX_050100';
--l_principal VARCHAR2(20) := 'APEX_180200';
BEGIN
DBMS_NETWORK_ACL_ADMIN.append_host_ace (
host => 'reqres.in',
lower_port => 80,
upper_port => 80,
ace => xs$ace_type(privilege_list => xs$name_list('http'),
principal_name => l_principal,
principal_type => xs_acl.ptype_db));
END;
/
Команда, которую я пытаюсь выполнить:
declare
l_response CLOB;
l_url varchar2(4000) := 'https://reqres.in/api/users?page=2'; --web service URL
l_result NUMBER;
begin
---get XML from
l_response := apex_web_service.make_rest_request(p_url => l_url,
p_http_method => 'GET'
-- p_parm_name => apex_util.string_to_table('p_int_1:p_int_2'),
-- p_parm_value => apex_util.string_to_table('12:12')
);
dbms_output.put_line(l_response);
----parse the response
--l_result :=apex_web_service.para(p_xml => XMLTYPE(l_response), --convert CLOB to XML
-- p_xpath => '//number/text()'
-- );
dbms_output.put_line(l_result);
--APEX_JSON.parse(l_result); -- APEX_JSON is not available
end;