1

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??

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
MKN
  • 497
  • 3
  • 8
  • 24
  • Are you executing the `crate_acl` call as `SCOTT` or as a privileged user, e.g. as `SYS`? The ability to manipulate ACLs is restricted and permissions have to be granted - sparingly - on the package to any other (privileged) users who should be able to set them up. Oherwise, what would be the point of having them at all? – Alex Poole Apr 11 '13 at 06:59
  • I tried to execute in SYS also it says same – MKN Apr 11 '13 at 08:51
  • 1
    Your question makes no sense - the error message is from Oracle 11g (since ACLs were introduced then), but you tagged it as oracle10g. What server version are you running? – Frank Schmitt Apr 11 '13 at 09:13
  • Sorry i wrongly tagged..I am changing now – MKN Apr 11 '13 at 12:26
  • 1
    Your call to dbms_network_acl_admin seems fine (apart from the missing end of the PL/SQL block) - copy, paste&run worked for me. Are you 100% sure you ran it as SYS? – Frank Schmitt Apr 11 '13 at 12:34
  • This looks related to https://stackoverflow.com/questions/44393679/how-to-sent-a-post-request-with-form-data-and-parameters-in-pl-sql?noredirect=1&lq=1 – Jika Jun 21 '17 at 07:51

0 Answers0