Skip to Main Content

APEX

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!

apex_web_service.make_rest_request p_transfer_timeout not working as expected

Jake4321Mar 10 2021

Hi all,
I have this APEX page with a Submit button in which I have a PL/SQL dynamic action that submits a "POST" to a third party application.
I would like to show the status (success or failure) of the "POST" on my page once the third party application sends a response or times out.
the PL/SQL is as follow:
-- prepare request info
-- send the request
l_response := apex_web_service.make_rest_request(p_url => v_url, p_http_method => 'POST', P_body => v_body, p_transfer_timeout=> 15);
-- analyze the response and status
if apex_web_service.g_status_code = 201 then
-- success process ...
else
-- failure process ...
end if;
The code execute perfectly, even the analyze response code but it seems this last part is executed async. (i.e. the user gets control of the APEX page and needs to refresh manually to see the actual result items (status and comments) being displayed in the page.
Question:
1- Is there a way to make this process synchronous and wait for the third party response before giving control to the user (I was expecting the p_transfer_timeout parameter to do this but it does not appear to do so)
or
2- refreshing the Page from PL/SQL once the response is provided by the third party application?
Any tips, comments, suggestions are greatly appreciated as usual.
Thanks,
Jake

This post has been answered by jariola on Mar 30 2021
Jump to Answer
Comments
Post Details
Added on Mar 10 2021
7 comments
2,665 views