PL/SQL (MOSC)

MOSC Banner

Getting operation timeout error in utl_http call

edited Mar 2, 2020 1:36PM in PL/SQL (MOSC) 2 commentsAnswered

Requirement: I need to hit an URL (i.e middleware Triggering URL).

While I am trying to trigger the middleware url from back end by using the following PL/SQL I am getting following error.

create or replaceprocedure TEST_URL( P_TRIG_FLAG in varchar2, P_UNIQ_ID in number) is  req utl_http.req;  res utl_http.resp;  url varchar2(4000) := 'https://middleware.url/triggerpoint';  name varchar2(4000);  buffer varchar2(4000);   content varchar2(4000) := '{"EVENT":"'||P_TRIG_FLAG||'", "UNIQUE_ID":"'||P_UNIQ_ID||'"}';begin  UTL_HTTP.set_transfer_timeout (300);   dbms_output.put_line('Welcome1');  req := utl_http.begin_request(url, 'POST',' HTTP/1.0');   dbms_output.put_line('Welcome1.1');    --utl_http.set_header(req, 'user-agent', 'mozilla/4.0');   utl_http.set_header(req, 'content-type', 'application/json');   utl_http.set_header(req, 'Authorization', 'Bearer UlQnhjHxnMLcKpLM4eH0XBrxFG9A35345ZepI');  utl_http.set_header(req, 'Content-Length', length(content)); dbms_output.put_line('Welcome2'); utl_http.write_text(req, content);  res := utl_http.get_response(req);   dbms_output.put_line('res');  -- process the response from the HTTP call  /*begin    loop      utl_http.read_line(res, buffer);      dbms_output.put_line(buffer);    end loop;   utl_http.end_response(res);*/     exception    when Others     then      dbms_output.put_line('Sqlerrm'||SQLERRM);      dbms_output.put_line('errorcode'||SQLCODE);end TEST_URL;Sqlerrm :ORA-29273: HTTP request failedORA-12535: TNS:operation timed outerrorcode-29273

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center