Hi All,
There was a request to convert our data in xml type format using rest post process.
Below is scenario, here we are taking xml_result varibale, how to post that variable in our rest web service.
declare
l_clob CLOB;
l_result VARCHAR2(32767);
v_empid number;
v_empname varchar2(30);
xml_result xmltype;
l_empid number;
l_name varchar2(500);
BEGIN
select empid,empname into v_empid,v_empname from emp_result where empid='101'; --this value will be passing dynamic
select xmlelement("Head",XMLforest(empid,empname)) into xml_result from emp_result where empid='101';
-- Get the XML response from the web service.
l_clob := APEX_WEB_SERVICE.make_rest_request(
p_url=>'http://10.222.156.77:7080/RESTfulWebService/helloGet3Xml',
p_http_method => 'POST',
p_parm_name => APEX_UTIL.string_to_table('empId:empName'),
p_parm_value => APEX_UTIL.string_to_table(l_empid||':'||l_name)
--p_parm_value => APEX_UTIL.string_to_table(201||':'||'Welcome Sri')
);
-- Display the whole SOAP document returned.
DBMS_OUTPUT.put_line('l_clob=' || l_clob);
END;
Regards,
Sruthitamiri