MKN
MKN

Reputation: 497

Calling HTTP pages from Plsql

I am trying to call a page from 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;

It said

ORA-29273: HTTP request failed ORA-06512: at "SYS.UTL_HTTP", line 1130 ORA-24247: network access denied by access control list (ACL) ORA-06512: at line 7

I tried to

     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
   );

I am getting this error ERROR at line 2: ORA-06550: line 2, column 3: PLS-00201: identifier 'DBMS_NETWORK_ACL_ADMIN' must be declared ORA-06550: line 2, column 3: PL/SQL: Statement ignored

How to get rid of this??

Upvotes: 1

Views: 5161

Answers (0)

Related Questions