Home » SQL & PL/SQL » SQL & PL/SQL » utl_http how to close the request? (Oracle 11g)
utl_http how to close the request? [message #617137] |
Wed, 25 June 2014 07:26  |
 |
tjagiello
Messages: 2 Registered: June 2014
|
Junior Member |
|
|
Hi,
after invoking this piece of code several times I get an error 'ORA-29270: too many open HTTP requests'.
Does not UTL_HTTP.end_response close request?
-- Initialize the CLOB.
DBMS_LOB.createtemporary(v_response_clob, FALSE);
generate_envelope(p_request, l_envelope,p_skip_records);
l_http_request := UTL_HTTP.begin_request(p_url, 'POST','HTTP/1.1');
UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml');
UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(l_envelope));
UTL_HTTP.set_header(l_http_request, 'SOAPAction', p_action);
UTL_HTTP.write_text(l_http_request, l_envelope);
l_http_response := UTL_HTTP.get_response(l_http_request);
-- Copy the response into the CLOB.
BEGIN
LOOP
UTL_HTTP.read_text(l_http_response, l_text, 32767);
DBMS_LOB.writeappend (v_response_clob, LENGTH(l_text), l_text);
END LOOP;
EXCEPTION
WHEN UTL_HTTP.end_of_body THEN
UTL_HTTP.end_response(l_http_response);
END;
I put end_request:
-- Initialize the CLOB.
DBMS_LOB.createtemporary(v_response_clob, FALSE);
generate_envelope(p_request, l_envelope,p_skip_records);
l_http_request := UTL_HTTP.begin_request(p_url, 'POST','HTTP/1.1');
UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml');
UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(l_envelope));
UTL_HTTP.set_header(l_http_request, 'SOAPAction', p_action);
UTL_HTTP.write_text(l_http_request, l_envelope);
l_http_response := UTL_HTTP.get_response(l_http_request);
-- Copy the response into the CLOB.
BEGIN
LOOP
UTL_HTTP.read_text(l_http_response, l_text, 32767);
DBMS_LOB.writeappend (v_response_clob, LENGTH(l_text), l_text);
END LOOP;
EXCEPTION
WHEN UTL_HTTP.end_of_body THEN
UTL_HTTP.end_response(l_http_response);
UTL_HTTP.end_request(l_http_request);
END;
and I get error ORA-29261: bad argument.
Did anyone encounter such problem?
Regards,
Tomasz
|
|
|
|
|
|
|
Goto Forum:
Current Time: Mon May 19 12:47:02 CDT 2025
|