0

Basically I want to create a REST Web Service using PL-SQL in Oracle and following are my requirements

  • It should accept string parameter. That string parameter could a JSON format string or XML data
  • It should not accept any parameters on the URL. Rather parameters should be received using http request object.
  • Web service should then able to read the input received and print the details. For ex. A simple web service that receives name of the person in JSON or xml format and then prints back 'Hello ' || Name
Harshad
  • 21
  • 1
  • The question is how do you create a PL-SQL webservice that will process POST data (xml or json format). I have seen web services that handle input parameters on the URL of the webservice. But I dont want that. Input parameters for my web service will come as a POST data because I want URL to be as clean as possible. So is it possible to create a web service that will process the POST data sent to the PL-SQL webservice. – Harshad Apr 02 '15 at 09:59
  • Not sure about using just pl/sql in the Oracle db server as a web container, not even sure this is possible without using tomcat or similar at a higher layer (or use nfusion middleware). Consuming web services, you can try utl_dbws or utl_http. – tbone Apr 05 '15 at 18:19

1 Answers1

0

Yes, you can do this. It can be done a few ways.

Way 1: using Oracle's Rest Listener you can easily setup a web service which is waiting for json or xml payload.

Way 2: using nodejs withan Oracle connector. Setup node to listen for incomming connections. Hand off the json/xml payload to Oracle.

Way 3: using nodeJs / Apache / mod_plsql. Use nodeJs to listen for incoming connection. Then hand off the payload to Oracle by posting the payload to Apache.

Brian McGinity
  • 5,777
  • 5
  • 36
  • 46
  • Hi, Do you have an example on how you do it using Way 1. – Harshad May 13 '15 at 16:10
  • I setup Way 1 and then setup Way 2 because I wanted to use Web Sockets too (I wanted to use NodeJs for WS). Once the Rest Listener is installed, it was pretty straight forward. You log into Apex and it's point and click. First install ORDS: http://oracle-base.com/articles/misc/oracle-rest-data-services-ords-3-installation-on-tomcat-7.php – Brian McGinity May 13 '15 at 19:26
  • When I did this, I installed version 2 of the Apex Listener - which was the name before it was called the Oracle Rest Listener and latter renamed to Oracle Rest Data Services. It was somewhat complex installing it as I was required to install Apex as well. It looks like in ORDS v3, Oracle removed the requirement to install Apex (a very good move) and it is now configured via the command line. I'll be installing v3 sometime in the next few days on a new machine. – Brian McGinity May 14 '15 at 08:35