Thursday, February 18, 2016

#477 REST enabled Oracle Database Cloud Service - my first experiences

I have heard that APEX supports REST so I decided to try this out on my SOA CS environment's
DB CS instance. AS per usual, I studiously avoided reading any documentation.
This should be simple, right?


I created a simple table Customers -











Now, as luck would have it I locked my ADMIN APEX user out.

This I fixed as follows -

ssh into the DB CS machine
start sqlplus

conn system/yourPwd@yourSOADB;

alter session set current_schema = APEX_050000;

select user_id, substr(user_name, 1,10), account_locked from wwv_flow_fnd_user;

update APEX_050000.WWV_FLOW_FND_USER
set web_password = 'yourNewPassword'
where user_name = 'ADMIN'
and user_id = yourUserId;
commit;
/

begin
wwv_flow_security.g_security_group_id := 10;
wwv_flow_fnd_user_api.UNLOCK_ACCOUNT('ADMIN');
commit;

end;

Then I logged into APEX and created a new workspace.
I then logged into this workspace -

I then clicked on SQL Workshop - RESTful Service -





























As you can see, the request is based on the simple query -
Select custname from customers

Click on the Test button to get the URL

https://yourIPAddress/ords/yourDB/yourAPEXWorkspace/niall/customers

I now try this out in Postman -


















I can now create a connection to this REST service in ICS.

For ICS, I create a variation of the above -

https://yourIPAddress/ords/yourDB/yourAPEXWorkspace/niall/customer/1

This REST request retrieves customer name based on custId.

Here is the result, when I test in Postman.










I create a REST connection in ICS based on the above.

See my blog post here  for the steps.


Good article on DB CS REST here


No comments: