Tuesday, March 22, 2022

Integrated SOA Gateway (ISG) - Exposing Standard API as REST Web Service

 In a nutshell, we need to perform following steps to expose PL/SQL as a web service:

1. Search API in Integration Repository 

2. Deploy API as REST Service 

3. Create Grants for REST Service 

4. Invoke EBS REST Service (in JSON message format) 

5. Verify the results 


Here we will take an example of creating a user by exposing FND_USER_PKG Interface API and then invoking it to create user. 


Following steps will explain the process of exposing the standard API and then invoking it. 


Step 1: Navigate to Integration Repository Responsibility, Click on Search. 



Then on search Page enter “FND_USER_PKG” in Internal Name and click on Go 



Step 2: Click on the search result, it will display List of methods available in the Interface Package.



Click on REST Web Service Tab



This page will display List of methods that can be deployed. 

Step 3: Now select Create/Update User (we will create a user by invoking this Service once Deployed.) and enter Service Alias (This is mandatory) and then Click on Deploy button at bottom. 

You will receive message that service is successfully deployed and the status will be deployed. 



Step 4: Now you will see the link to WADL file, Click on the link. It shows the physical location of the service endpoint where the service is hosted.

<?xml version="1.0" encoding="UTF-8"?> 
<application xmlns:tns1="http://xmlns.oracle.com/apps/fnd/rest/create_user/load_row/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://wadl.dev.java.net/2009/02" xmlns:tns="http://xmlns.oracle.com/apps/fnd/soaprovider/plsql/rest/fnd_user_pkg/" targetNamespace="http://xmlns.oracle.com/apps/fnd/soaprovider/plsql/rest/fnd_user_pkg/" name="FND_USER_PKG"><grammars><include xmlns="http://www.w3.org/2001/XMLSchema" 
href="http://xxx-xxx-apdv01.cli.ad:8005/webservices/rest/Create_User/?XSD=LOAD_ROW_SYNCH_TYPEDEF.xsd"/> 
</grammars> 
<resources base="http://xxx-xxx-apdv01.cli.ad:8005/webservices/rest/Create_User/"><resource path="load_row/"> 
<method name="POST" id="LOAD_ROW"><request><representation type="tns1:InputParameters" mediaType="application/xml"/> 
<representation type="tns1:InputParameters" mediaType="application/json"/> 
</request> 
</method> 
</resource> 
</resources> 
</application> 

Now open the link highlighted in Yellow in new Browser window, it will show the XSD file with input parameters that will be used later for invoking the Web Service. 

Step 5.Now Click on the Grants Tab, select Create/Update User and then click on Create Grant button 



Step 6: Select a grantee type. 
Grantee Type can be one of the following values: 
o USER - The grantee is an individual user who was selected directly. 
o GROUP - The grantee is a group of users or a member of a group of users. 
o GLOBAL - The grant was issued to all users. 

If you selected Specific User or Group of Users, specify the user or group for which to create the grants in the Grantee Name field. 
In our case, we will enter SYSADMIN and then click on Create Grant Button. 



Now the service has been exposed as a REST interface.

We can test the REST service via POSTMAN tool. Below would be the endpoint of REST service. 


https://hostname/webservices/rest/create_user/load_row/

Share:

0 comments:

Post a Comment