Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

utl_http post request in Oracle Soap procedure not working

user12251389Jan 29 2024 — edited Jan 29 2024

I have below Oracle Soap store procedure which was working fine previously. This Soap procedure actually calls the ODI Load Plan. We already change the Agent and host in ODI server and already tested from ODI client and its working successfully.

CREATE OR REPLACE PROCEDURE "PRC_CALL_ETL_R_DATA" 
IS
req_envelop VARCHAR2(4000) :=  '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:odi="xmlns.oracle.com/odi/OdiInvoke/">
<soapenv:Header/>
<soapenv:Body>
<odi:OdiStartLoadPlanRequest>
<Credentials>
<OdiUser>OUSER</OdiUser>
<OdiPassword>xxxxxx</OdiPassword>
<WorkRepository>WORKREP</WorkRepository>
</Credentials>
<StartLoadPlanRequest>
<LoadPlanName>LP_RDATA_LOAD</LoadPlanName>
<Context>DEVELOPMENT</Context>
<Synchronous>false</Synchronous>
<LogLevel>6</LogLevel>
</StartLoadPlanRequest>
</odi:OdiStartLoadPlanRequest>
</soapenv:Body>
</soapenv:Envelope>';
req utl_http.req;
res utl_http.resp;
res_envelop VARCHAR2(32767);
BEGIN
req := utl_http.begin_request('http://vm7265.bg.net:20910/oraclediagent/OdiInvoke?wsdl','POST','HTTP/1.1');
utl_http.set_header(req, 'Content-Type', 'text/xml');
utl_http.set_header(req, 'Content-Length', length(req_envelop));
utl_http.set_header(req, 'SOAPAction', 'invokeStartLoadPlan ');
utl_http.write_text(req, req_envelop);
res := utl_http.get_response(req);
utl_http.read_text(res, res_envelop);
utl_http.end_response(res);
dbms_output.put_line(res_envelop);
END;

But due to security issue we have to change the http request connection to https and we follow below oracle guideline:

https://oracle-base.com/articles/misc/utl_http-and-ssl

Now we change the Oracle Soap procedure like below :

CREATE OR REPLACE PROCEDURE "PRC_CALL_ETL_R_DATA" 
IS
req_envelop VARCHAR2(4000) :=  '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:odi="xmlns.oracle.com/odi/OdiInvoke/">
<soapenv:Header/>
<soapenv:Body>
<odi:OdiStartLoadPlanRequest>
<Credentials>
<OdiUser>OUSER</OdiUser>
<OdiPassword>xxxxxx</OdiPassword>
<WorkRepository>WORKREP</WorkRepository>
</Credentials>
<StartLoadPlanRequest>
<LoadPlanName>LP_RDATA_LOAD</LoadPlanName>
<Context>DEVELOPMENT</Context>
<Synchronous>false</Synchronous>
<LogLevel>6</LogLevel>
</StartLoadPlanRequest>
</odi:OdiStartLoadPlanRequest>
</soapenv:Body>
</soapenv:Envelope>';
req utl_http.req;
res utl_http.resp;
res_envelop VARCHAR2(32767);
BEGIN
utl_http.set_wallet('file:/u00/app/oracle/admin/RDMDC_RZ1/wallet', null);
req := utl_http.begin_request('https://vm7265.bg.net:20910/oraclediagent/OdiInvoke?wsdl','POST','HTTP/1.1');
utl_http.set_header(req, 'Content-Type', 'text/xml');
utl_http.set_header(req, 'Content-Length', length(req_envelop));
utl_http.set_header(req, 'SOAPAction', 'invokeStartLoadPlan ');
utl_http.write_text(req, req_envelop);
res := utl_http.get_response(req);
utl_http.read_text(res, res_envelop);
utl_http.end_response(res);
dbms_output.put_line(res_envelop);
END;

Now when we run Soap procedure it does not throw any error but eventually its not calling the ODI Load Plan. We are not sure what is the problem. Basically the problem seems to be from Oracle database side only as its not invoking and calling ODI Load plan.

Https is enabled in the database : SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;

Can anyone have idea what is the issue ?`

Thanks!

This post has been answered by Paulzip on Jan 29 2024
Jump to Answer
Comments
Post Details
Added on Jan 29 2024
9 comments
410 views