1

我正在尝试从 PLSQL 调用页面

declare
 httprequest        UTL_HTTP.req; 
   httpresp           UTL_HTTP.resp; 
   v_http_url         VARCHAR2 (200) := 'http://localhost:38801/BatchMvcDriver/Index?ID=161';
    begin
      httprequest := UTL_HTTP.begin_request (url         => v_http_url, 
                                             method      => 'POST'); 
                UTL_HTTP.set_header (httprequest, 
                                     'Content-Type', 
                                     'text/xml; charset=utf-8' 
                                    ); 
                UTL_HTTP.set_header (httprequest, 'Content-Length', 64); 
                UTL_HTTP.write_line (httprequest, 'some string'); 
                httpresp := UTL_HTTP.get_response (httprequest); 
                UTL_HTTP.end_request (httprequest); 
                UTL_HTTP.end_response (httpresp);
    end;

它说

ORA-29273:HTTP 请求失败 ORA-06512:在“SYS.UTL_HTTP”,第 1130 行 ORA-24247:网络访问被访问控制列表 (ACL) 拒绝 ORA-06512:在第 7 行

我尝试过了

     begin
   dbms_network_acl_admin.create_acl (
     acl         => 'utl_http.xml',
     description => 'HTTP Access',
     principal   => 'SCOTT',
     is_grant    => TRUE,
     privilege   => 'connect',
     start_date  => null,
     end_date    => null
   );

我在第 2 行收到此错误错误:ORA-06550:第 2 行,第 3 列:PLS-00201:必须声明标识符 'DBMS_NETWORK_ACL_ADMIN' ORA-06550:第 2 行,第 3 列:PL/SQL:语句被忽略

如何摆脱这个?

4

0 回答 0