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!

ORDS rest service receiving xml data posted by other app

Mike286Feb 24 2017 — edited Feb 24 2017

Hi There,

I am trying to create an ORDS rest web service where it will accept xml data posted by a third vendor application and I am having trouble to get the data in. Here is what I have done:

1. create a stored procedure in my database:

create or replace procedure azure_test(in_body in clob) is

     rs_group varchar2(50);

     in_status varchar2(400);

     x_xml xmltype;

begin

     x_xml:=xmltype(:in_body);

     SELECT xt.* into rs_group,in_status

     FROM

           XMLTABLE('/Data'

              PASSING x_xml

              COLUMNS

                "RG_GROUP"   VARCHAR2(40)  PATH 'rs_group',

                "Status"    VARCHAR2(10) PATH 'status'

              ) xt; 

  insert into mytrace values(bb||'/'||cc);

end;

2. Create an ORDS rest web service(put operation) and link it to the procedure:

(Source Type:PL/SQL, MIME TYPE: application/xml)

  begin

      azure_test(:body);

  end;

3. Now in the client side, call this web service with following in body(xml):

<Data>

<rs_group>xxxx-prd</rs_group>

<status>Success</status>

</Data>

At this time, I am expecting it will pass this xml over and my procedure will parse it and get the data and insert into my table, but instead I am getting 500 errors.

I am not so sure whether this is the correct way to passing the xml data to the ORDS web service. If not, how to accept the xml data posted by other client?

Thanks

This post has been answered by Mike Kutz on Feb 24 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2017
Added on Feb 24 2017
6 comments
1,188 views