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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Create a Declarative Web Service using POST Method

ade_adekoyaJun 27 2017 — edited Jun 28 2017

Hello

Environment :

OracleXE 11gr2

APEX5.03

Windows7

I am trying to Integrate APEX with the JIRA Issue tracking Cloud platform.

I have created my JIRA Webservice to add an Issue comment.

https://docs.atlassian.com/jira/REST/cloud/#api/2/issue/{issueIdOrKey}/comment-addComment

This works in PL/SQL (Reverse Proxy method NOT Oracle Wallet)

declare

L_json_clob clob;

L_json_response varchar2(15000);

begin

apex_web_service.g_request_headers(1).name := 'Content-Type';

apex_web_service.g_request_headers(1).Value := 'application/json';

L_json_clob := '{"body": "This is Tuesday''s 3rd test comment from the Oracle Database api regarding the quality of the response."}';

L_json_response := apex_web_service.make_rest_request

  ( p\_url           => '[http://NUK20002443/atlassian/rest/api/latest/issue/DBRPT-1953/comment](http://NUK20002443/atlassian/rest/api/latest/issue/DBRPT-1953/comment)' 

  , p\_http\_method   => 'POST' 

  , p\_username      => \<username>

  , p\_password      => \<password>

  , p\_body          => L\_json\_clob

  );

dbms_output.put_line('This is L_json_response '|| L_json_response);

EXCEPTION

WHEN OTHERS THEN

  raise\_application\_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);

end;

I would like to create the REST Web Reference declaratively using APEX 5.03 with Username, Password and Comment as input parameters.

This is my REST Web Reference Object

rest_webservice.PNG

I then built my Form using the Wizard. Clicking submit did not POST my comment.

Is very confusing where my p_body => L_json_clob goes in my REST Web Reference.

Can any body assist with the REST Web Reference declaration and any form parameters?

Kind Regards

Ade

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 26 2017
Added on Jun 27 2017
4 comments
1,156 views