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 API Bug?

Denes KubicekMay 22 2015 — edited May 26 2015

I have a funny case here. To me it seems there is a bug in the apex_web_service API or I just don't see the forest for the trees.

I created a simple webservice at apex.oracle.com using PUT method. The PL/SQL is like this:

BEGIN

UPDATE emp

  SET sal = :p\_sal

WHERE empno = :p\_empno;

:p_response := 'Success: ' || :p_empno || ' > ' || :p_sal;

END;

This is the webservice definition:

pastedImage_2.png

Now, I used the http resource test in Firefox and tried to call the webservice. It worked:

Record before runing http resource test:

pastedImage_5.png

Record after running http resource test:

pastedImage_12.png

pastedImage_15.png

The actual problem is, if I run the webservice call from the SQL workshop using the following code:

DECLARE

v_response VARCHAR2 (4000);

v_vc_arr1 apex_application_global.vc_arr2;

v_vc_arr2 apex_application_global.vc_arr2;

BEGIN

v_vc_arr1 := apex_util.string_to_table ('p_empno:p_sal');

v_vc_arr2 := apex_util.string_to_table (7839 || ':' || 5500);

v_response :=

  apex\_web\_service.make\_rest\_request

        (p\_url              => '[http://apex.oracle.com/pls/apex/dkubicek/update_emp/](http://apex.oracle.com/pls/apex/dkubicek/update_emp/)',

         p\_http\_method      => 'PUT',

         p\_parm\_name        => v\_vc\_arr1,

         p\_parm\_value       => v\_vc\_arr2

        );

DBMS_OUTPUT.put_line ('*' || v_response || '*');

END;

pastedImage_28.png

the procedure will complete but there is no response and no update on the corresponding record. I did the same thing in my local environment and the results are almost the same. Once the procedure completed in my local environment, I received at least an empty response >

{"p_response":"Success: "}

Basically, nothing happens and it seems that the parameters and their values are not transferred as expected.

Am I doing something wrong or this is simply a bug?

Denes Kubicek

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 23 2015
Added on May 22 2015
1 comment
443 views