Skip to content

Commit

Permalink
Merge pull request mortenbra#56 from eaolson/issue28
Browse files Browse the repository at this point in the history
Fix for issue 28
  • Loading branch information
mortenbra authored Jun 18, 2018
2 parents 0fab97d + af005d4 commit 8a46dc2
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions ora/flex_ws_api.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ is
l_hdr_value varchar2(1024);
l_hdr header;
l_hdrs header_table;
l_returnvalue xmltype;
begin

-- determine database characterset, if not AL32UTF8, conversion will be necessary
Expand Down Expand Up @@ -389,13 +390,17 @@ begin
end;

utl_http.end_response(l_http_resp);

begin
l_returnvalue := xmltype.createxml( l_clob );
exception when others then
if sqlcode = -31011 then -- invalid xml
raise_application_error( -20001, 'HTTP response could not be converted to XML. Response was (first 1000 characters): ' || dbms_lob.substr( l_clob, 1000 ));
end if;
end;
dbms_lob.freetemporary( l_clob );

return xmltype.createxml(l_clob);

exception when others then
if sqlcode = -31011 then -- its not xml
return null;
end if;
return l_returnvalue;
end make_request;

function make_rest_request(
Expand Down

0 comments on commit 8a46dc2

Please sign in to comment.