I'm using Apex 5.0.3, JR Server 6.2 and11g DB.
I basically followed the article below.
http://damien.antipa.at/2011/11/04/apex-and-jasperserver-tunnel-plugin/
I did verify that the ACL is ok and also the URL being generated below can be access directly via browser and it works ok
http://serv-ora11g:8081/jasperserver/flow.html?_flowId=viewReportFlow&j_username=jasperadmin&j_password=jasperadmin&repo…
I debug the code, below is the error and also please see the bold line below causing an error.
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1369
ORA-29263: HTTP protocol error
PROCEDURE call_report(p_report_name VARCHAR2, p_parameter type_parameter)
IS
v_url VARCHAR2(4000);
v_request sys.utl_http.req;
v_response sys.utl_http.resp;
v_file BLOB;
v_download RAW(32767);
BEGIN
v_url := build_url(p_report_name, p_parameter);
v_request := sys.utl_http.begin_request(v_url);
sys.utl_http.set_header(v_request, 'User-Agent', g_user_agent);
-- this is the line causing an error
v_response := sys.utl_http.get_response(v_request);
dbms_lob.createtemporary(v_file, TRUE, dbms_lob.session);
LOOP
BEGIN
sys.utl_http.read_raw(v_response, v_download);
dbms_lob.writeappend(v_file, utl_raw.length(v_download), v_download);
EXCEPTION WHEN sys.utl_http.end_of_body THEN
EXIT;
END;
END LOOP;
sys.utl_http.end_response(v_response);
owa_util.mime_header('application/' || output_format, false);
htp.p('Content-length: ' || dbms_lob.getlength(v_file));
htp.p('Content-Disposition: attachment; filename="' || p_report_name || '.'|| output_format ||'"');
owa_util.http_header_close;
wpg_docload.download_file(v_file);
dbms_lob.freetemporary(v_file);
END call_report;