Want to publish some RESTful services using SQL Developer and Oracle REST Data Services (ORDS)?
You’re in luck!
View > REST Data Services > Development.
Before you can do this, a few things.
- you’ll need to install and run ORDS
- you’ll need to REST enable a schema
- you’ll need to have created an ORDS user with the ‘SQL Developer’ role
When installing ORDS, you’re prompted to create two users, and ADMIN user for configuring ORDS, and a development user for publishing RESTful Service modules.
You may have skipped this step. Oops.
Or maybe you need to create a new user.
If you try to login using an invalid user/connect, then you’ll get this:
So how are we connecting? If we look at the connection properties, we see this:
So I’m asking to connect over HTTP (if you picked secure/https – this won’t work), to server ‘localhost’ on port ‘8080’ using user ‘ords_dev’, and we’re doing ORDS RESTFul services (vs APEX) – so that’s ‘/ords’, and then our schema is ‘/peeps/’ – which is what I aliased HR to when I REST enabled it.
When ORDS gets a request and it sees ‘/ords’ – it switches to REST enabled schemas and schema objects and modules. Otherwise, it sees your request as an APEX thing. The bit that comes AFTER ‘/ords’ will be the schema name or schema alias.
So…either my user is setup wrong, or I forgot to set it up.
Jump to the box where ORDS is running. Find your .war file. If you do a ‘ps -ef | grep ords.war’ you should see where ORDS is running out of. Then you can create the user like so:
By the way, this is covered in the Docs, the Admin and Dev Guide to be specific.
Now we’re cooking with gas. Now I can connect and pull down and push up modules for my RESTful Services.
What if you’re not running ORDS in standalone mode?
If you’re running it in Glassfish or WebLogic, then you’ll still create a user – a Glassfish user – and give it the ‘SQL Developer’ role. So same difference basically.