Exposing Custom PLSQL Package As Oracle Rest Web Service1 PDF
Exposing Custom PLSQL Package As Oracle Rest Web Service1 PDF
The acronym REST stands for Representational State Transfer, this basically means that each unique URL
is a representation of some object. REST describes a set of architectural principles by which data can be
transmitted over a standardized interface (such as HTTP). You can get the contents of that object using
an HTTP GET, to delete it, you then might use a POST, PUT, or DELETE to modify the object (in practice
most of the services use a POST for this).
Now to get started with implementing the Service on your application we first need to perform some
pre-requisites like application of adviced PATCH on the Application.
To get started please connect with the DBA and follow the Metalink Doc Id: 1311068.1
Please find the doc that would be handy for the DBA to perform the setup’s
Once all the setup is done just confirm if the below roles are added else add the roles to the desired user
say sgunti
Click on Assign Roles and Responsibility “Integrated SOA Gateway” and “Integration Administrator”
Now login using your desired user say sgunti and then
Now lets design our own Package and expose the data, the idea is when Customer TRX ID is passed as a
Input the data that would be exposed to the calling application is the Customer Name.
Here above the highlighted section is the Annotation part which is an important section as part of Rest
Service deployment.
Categories is where exactly your package would be placed under which module of standard interface
section as in Integration Respository screen as above.
Now here is the Package Body that would except a Customer TRX ID and return the Customer Name.
RETURN l_return_msg;
--
EXCEPTION
WHEN OTHERS
THEN
l_return_msg := SQLCODE || SQLERRM;
RETURN l_return_msg;
--
END get_validate_cust;
--
PROCEDURE check_valid_cust (p_customer_trx_id IN VARCHAR2,
x_return_status OUT VARCHAR2,
x_return_message OUT VARCHAR2)
IS
l_customer_name VARCHAR2 (1000);
BEGIN
BEGIN
SELECT hp.party_name CUSTOMER_NAME
INTO l_customer_name
FROM ra_customer_trx_all rcta,
hz_cust_accounts_all hca,
hz_parties hp
EXCEPTION
WHEN OTHERS
THEN
x_return_status := fnd_api.g_ret_sts_error;
x_return_message := SQLCODE || SQLERRM;
END check_valid_cust;
--
END xx_custname_validate_pkg;
/
Compile the Package Specification and Package Body using the tools like Toad or SQL Developer.
Now place only the Spec File to /tmp directory to create the .ildt File
Generating the .pls file to .iltd file using the below command
Click on SEARCH button to search for your custom designed Package Specification
WADL File
Now give the GRANT by navigating to GRANTS Tab, Click on Create Grant
javac RestClient_19JUNE.java
The above response is based on the Input that we have passed that is the Customer Trx Id and would
return the Customer Name.
Thank You!!!! Please do share your feedbacks for the knowledge on REST Web Service..