2015-04-20 47 views
1

我在AC1下有用戶名,並且acl已被分配給主機。 但我得到錯誤http_req提交的努力connact從內部調用webservice pl/sql

ACL已經被分配給主機

SELECT * FROM dba_network_acls; 
1 *.mer.com   /sys/acls/fine_grain_access_http.xml   968743177C0D29D9E040A8C02F1C05F0 

用戶已添加到ACL連接並解決省

SELECT * FROM dba_network_acl_privileges where principal=’SCOTT’ 
ACL         ACLID         PRINCIPAL PRIVILEGE IS_GRANT INVERT 
1 /sys/acls/fine_grain_access_http.xml 968743177C0D29D9E040A8C02F1C05F0  PRASHANT-MISHRA connect   true  false  
2 /sys/acls/fine_grain_access_http.xml 968743177C0D29D9E040A8C02F1C05F0  PRASHANT-MISHRA resolve  true  false  
下面

是代碼段我正在執行

DECLARE 
req UTL_HTTP.req; 
resp UTL_HTTP.resp; 
v_URL VARCHAR2(2000); 
VALUE VARCHAR2(32767); 
Rpt_id NUMBER:=38660; 
part1 VARCHAR2(200); 
part2 VARCHAR2(100); 
part3 VARCHAR2(100); 
username VARCHAR2(100):='PRASHANT-MISHRA'; 
pass VARCHAR2(100):='[email protected]'; 
BEGIN 
part1:='http://jira.mer.com/sr/jira.issueviews:searchrequest-xml/'; 
part2:='/SearchRequest-38660tempMax=3000&'; 
part3:='field=key'; 
v_URL:=part1||part2||Rpt_id||part3; 

req := UTL_HTTP.begin_request(v_URL,'GET','HTTP/1.1'); 

UTL_HTTP.set_authentication(req, username, pass); 
UTL_HTTP.set_header (req,'Content-Type','application/xml; charset=utf-8'); 
/*UTL_HTTP.set_header(req, ‘User-Agent’, ‘Mozilla/4.0′);*/ 
resp := UTL_HTTP.get_response(req); 
LOOP 
UTL_HTTP.read_line(resp, value, TRUE); 
DBMS_OUTPUT.PUT_LINE(value); 
END LOOP; 
UTL_HTTP.end_response(resp); 
END; 

錯誤:

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 19

+0

您是否給予用戶資助? '批准執行utl_http到XXXXX',這裏是我回答之前的問題http://stackoverflow.com/questions/24808240/how-to-run-http-web-service-request-from-pl-sql-包/ 29012077#29012077 –

回答

1

運行add_priv後,我忘記了提交更改以將用戶的priv添加到ACL。