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!

How to get Response from apex_web_service.make_rest_request??

MehabubRSheikhNov 12 2020

Hi,
I have a NodeJS application which host my REST Webservice to return a PDF document as a Base64 encoded string data. I am calling this web service from APEX using the following code
DECLARE
l_cursor SYS_REFCURSOR;
l_body_clob clob;
l_resp_clob clob;
l_blob BLOB := empty_blob();
--l_blob BLOB;
l_step number := 22500;
BEGIN
DBMS_LOB.OPEN(l_blob, DBMS_LOB.LOB_READONLY);
OPEN l_cursor FOR
SELECT cust.customer_name,
cursor(select
products.product_name
,case
when products.uom_type ='RANGE_VALUE' then
products.range_low||products.uom||'-'||products.range_high||products.uom
else
products.absolute_value||products.uom
end reference_range
from xxdiag.xxeba_patient_order_lines_all lines,
xxdiag.eba_cust_products products,
xxdiag.eba_cust_product_families fam
where orders.order_header_id = lines.order_id
and lines.product_id = products.id
and products.product_family_id = fam.id) lines
FROM xxdiag.eba_cust_customers cust,
xxdiag.xxeba_patient_orders orders
WHERE orders.customer_id = cust.id;
APEX_JSON.initialize_clob_output;

APEX_JSON.open_object;
APEX_JSON.write('orders', l_cursor);
APEX_JSON.close_object;
l_body_clob := APEX_JSON.get_clob_output;
apex_web_service.g_request_headers.delete();
apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).value := 'application/json';
apex_web_service.g_request_headers(2).name := 'TemplateName';
apex_web_service.g_request_headers(2).value := 'Biochemistry';
l_resp_clob := apex_web_service.make_rest_request(
p_url => '***' - the REST WebService URL
p_http_method => 'POST',
p_body => l_body_clob
);
DBMS_OUTPUT.put_line('Response:'||l_resp_clob);
APEX_JSON.free_output;

END;
But I am not able capture the response. When I call the same web service using soapui I get the response.
Could you please help me?

Thanks,
Mehabub

This post has been answered by APEX4EBS on Nov 12 2020
Jump to Answer

Comments

thatJeffSmith-Oracle
Answer

Sorry, this forum space isn't for EM Express or 12c-specific questions, it's for the Oracle SQL Developer IDE/GUI

Marked as Answer by 2662756 · Sep 27 2020
2662756

Thanks!, let me go to the correct forum

unknown-7404

Repost in the Multitenant forum and see my reply dated Apr 22, 2014 3:54 PM in this thread:

https://community.oracle.com/thread/3550674

Oracle 12c uses a NEW, and different, multitenant architecture. That requires that certain, basic operations (e.g. creating users, connecting) are done DIFFERENTLY.

If you want to avoid the RTFM responses that might be coming your way read jump the gun on them by reading chapters 17 and 18 in the Database Concepts doc. Those chapters, and my reply in that thread, will answer your question.

http://docs.oracle.com/cd/E16655_01/server.121/e17633/cdbovrvw.htm

1 - 3

Post Details

Added on Nov 12 2020
2 comments
7,772 views