Dietmars integration kit has a stored procedure for making calls which today for some weird reason wasn't working today. I was getting a corrupted PDF back, it was working fine for other reports.
So created a new stored procedure as below and it works. So its an alternate way of doing the same thing.
create or replace procedure download_pdf_report(p_url IN VARCHAR2, p_output_file in varchar2) is l_blob blob; BEGIN DBMS_LOB.createtemporary(l_blob, false); l_blob := httpuritype.createuri(p_url).getblob(); owa_util.mime_header('application/pdf',false); htp.p('Content-Disposition: attachment; filename='||p_output_file); htp.p('Content-length'||dbms_lob.getlength(l_blob)); owa_util.http_header_close; wpg_docload.download_file(l_blob); END;