Hi All,
When we try to call OIC (Gen3) integration using this apex_web_service.make_rest_request call we are getting this error .
Error report -
ORA-29273: HTTP request failed
ORA-06512: at "APEX_210200.WWV_FLOW_WEB_SERVICES", line 1182
ORA-06512: at "APEX_210200.WWV_FLOW_WEB_SERVICES", line 782
ORA-12535: TNS:operation timed out
ORA-06512: at "SYS.UTL_HTTP", line 380
ORA-06512: at "SYS.UTL_HTTP", line 1209
ORA-06512: at "APEX_210200.WWV_FLOW_WEB_SERVICES", line 756
ORA-06512: at "APEX_210200.WWV_FLOW_WEB_SERVICES", line 1023
ORA-06512: at "APEX_210200.WWV_FLOW_WEB_SERVICES", line 1371
ORA-06512: at "APEX_210200.WWV_FLOW_WEBSERVICES_API", line 626
ORA-06512: at line 18
29273. 00000 - "HTTP request failed"
*Cause: The UTL_HTTP package failed to execute the HTTP request.
*Action: Use get_detailed_sqlerrm to check the detailed error message.
Fix the error and retry the HTTP request.
Sample sql code:
declare
l_response clob;
begin
apex_web_service.oauth_authenticate( p_token_url => 'https://xxxx.identity.oraclecloud.com/oauth2/v1/token',
p_client_id => 'xxxx',
p_client_secret => 'xxxxx123',
p_scope=> 'https://xxxxxx.integration.ocp.oraclecloud.com:443urn:opc:resource:consumer::all');
apex_web_service.g_request_headers.DELETE();
apex_web_service.g_request_cookies.DELETE();
apex_web_service.g_request_headers(1).name:='Content-Type';
apex_web_service.g_request_headers(1).value:='application/octet-stream';
apex_web_service.g_request_headers(2).name:='Authorization';
apex_web_service.g_request_headers(2).value:='Bearer '||apex_web_service.oauth_get_last_token;
dbms_OUTPUT.PUT_line('Token '||apex_web_service.oauth_get_last_token ) ;
dbms_OUTPUT.PUT_line('Token1 ');
l_response := apex_web_service.make_rest_request(
p_url =>'https://xxxxx.ocp.oraclecloud.com/ic/api/integration/v1/integrations/xxxx_DOWNLOAD_FILE_OBJSTG%7C03.00.0000/schedule/jobs?integrationInstance=xxxx-yzzzz-to',
--p_url =>'https://xxxx-yzzzz-to.integration.ca-toronto-1.ocp.oraclecloud.com/ic/api/integration/v1/integrations/XXXX_DOWNLOAD_FILE_OBJSTG%7C03.00.0000/schedule/jobs?integrationInstance=xxxx-yzzzz-to',
p_http_method => 'POST'
, p_transfer_timeout => 300
,p_body=>'{"action":"NOW"}'
);
dbms_OUTPUT.PUT_line('API Statuscode '||apex_web_service.g_status_code);
dbms_OUTPUT.PUT_line('API Response '||l_response ) ;
dbms_OUTPUT.PUT_line('SQl ERRM '||sqlerrm ) ;
for i in 1.. apex_web_service.g_headers.count loop
dbms_output.put_line('Name ->'||apex_web_service.g_headers(i).name);
dbms_output.put_line('Value ->'||apex_web_service.g_headers(i).value);
end loop;
end;
--------------
initially when we try call using runtime url , it ended with 307 status , ( 307 mean it trying re-direct the url ) , so later i gave it to designer url, it through this error. We are getting authorization tocken without any issue , only to call the OIC we are getting error . Any suggestion please . The same call working properly in POSTMAN tool. the issue is from ATP only. Please advise is it anything i missing in the script or OCI or OIC side anything i need to check.
Siva.