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 post xml value in rest web service by using oracle pl/sql

Sruthi TamiriMar 16 2016 — edited Mar 18 2016

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

This post has been answered by Pavel_p on Mar 18 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 15 2016
Added on Mar 16 2016
11 comments
2,619 views