DB-REST access
ACL(Access control list)
ORDS(Oracle REST Data Service)
- It is a list of access control entries to restrict the hosts that are allowed to connect to the Oracle database.
- ACLs are created using dbms_network_acl_admin and dbms_network_acl_utility packages.
Calling WebServices from Oracle PLSQL:
- Links
- https://www.youtube.com/watch?v=avBgGPw0_sA&t=16s
- https://slobaray.com/2015/02/05/calling-web-services-from-oracle-plsql/
- http://www.dba-oracle.com/t_advanced_utl_http_package.htm
- https://gist.github.com/ser1zw/3757715
- https://www.oradev.com/utlhttp.html
- https://docs.oracle.com/cd/F49540_01/DOC/server.815/a68001/utl_http.htm
- In Oracle we have a package called UTL_HTTP. By using this package we can call web services using a POST method and get a response from it.
- To use any web services we need to register the URL in our DB by assigning it to the Access Control List (ACL). Here is the below code which need to be executed under SYS user, so that we can utilize it based on any primary users on the schema. I am using to demonstrate this with Oracle Database 11g Release 11.2.0.1.0
- /
BEGINdbms_network_acl_admin.create_acl(acl => 'www.xml',description => 'Test Sample ACL',principal => 'VDESU',is_grant => TRUE,privilege => 'connect');dbms_network_acl_admin.add_privilege(acl => 'www.xml',principal => 'VDESU',is_grant => TRUE,privilege => 'resolve');dbms_network_acl_admin.assign_acl(acl => 'www.xml',host => 'reqres.in');dbms_network_acl_admin.assign_acl(acl => 'www.xml',host => 'www.oradev.com');END;/COMMIT/grant execute on UTL_HTTP to VDESU; - SELECT * FROM DBA_NETWORK_ACLS;
SELECT * FROM DBA_NETWORK_ACL_PRIVILEGES;
declare
t_result
varchar2(4000);
begin
t_result := utl_http.request('https://www.oradev.com/index.html');
-- do somthing
end;
/
Comments
Post a Comment