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 timeout issue

825772Jan 6 2011 — edited Jan 10 2011
I have a stored procedure that makes a call to a web service using the following code snippet:

......
req := utl_http.begin_request(url => p_url_in, method => 'POST');
-- Set the HTTP request headers.
utl_http.set_header(r => req, name => 'Content-Type', VALUE => p_data_type);
utl_http.set_header(r => req, name => 'Content-Length', VALUE => to_char(LENGTH(data_in)));
utl_http.set_header(r => req, name => 'MessageType', VALUE => 'CALL');

IF p_username_in IS NOT NULL THEN
utl_http.set_authentication(r => req, username => p_username_in, password => p_password_in, scheme => 'Basic', for_proxy => FALSE);
END IF;

utl_http.write_text(r => req, data => data_in);
-- Write the data to the body of the HTTP request.
utl_http.write_text(r => req, data => data_in);
-- Process the request and get the response.
resp := utl_http.get_response(r => req, return_info_response => TRUE);

.....

The problem comes if the name of the machine specified in p_url_in is present on the network but the service requested is not present, for example the web server is down, utl_http waits for about 3 minutes before returning. This is the case even if I call utl_http.set_transfer_timeout(10); before utl_http.begin_request is called, as per other posts that I have found. Is there anyway to alter the timeout for the request?

TIA

Graham Harris
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 7 2011
Added on Jan 6 2011
7 comments
2,761 views