Deploying REST Web Services

Oracle E-Business Suite Integrated SOA Gateway allows the administrator to deploy interface definitions as REST services. These interfaces are PL/SQL APIs, Concurrent Programs, Java Bean Services, and Application Module Services. Among these interfaces, only PL/SQL APIs and Concurrent Programs can be exposed as both SOAP and REST services.

Deploying REST Services in the REST Web Service Tab

Before deploying a REST service, the administrator must perform the following tasks:

REST Service Security

All REST services are secured by HTTP Basic Authentication or Token Based Authentication at HTTP or HTTPS transport level. Either one of the authentication methods will be used in authenticating users who invoke the REST services.

Click Deploy to deploy the selected service operations to an Oracle E-Business Suite managed server for consumption.

After Service Deployment

Once the REST service has been successfully deployed, the REST Web Service tab has the following changes:

Reviewing Deployed WADL

To view the deployed REST service WADL, click the View WADL link.

The following example shows the deployed WADL for the selected CREATE_INVOICE service operation contained in the PL/SQL API Invoice Creation (AR_INVOICE_API_PUB):

Note: Please note that 'Invoice' highlighted here is the service alias entered earlier prior to the service deployment. After the service is deployed, the specified alias name (Invoice) becomes part of the service endpoint in the .xsd schema file.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?> 
<application xmlns:tns="http://xmlns.oracle.com/apps/ar/soaprovider/plsql/rest/ar_invoice_api_pub/" xmlns="http://wadl.dev.java.net/2009/02"
xmlns:tns1="http://xmlns.oracle.com/apps/ar/rest/ar/create_invoice/" name="AR_INVOICE_API_PUB" 
targetNamespace="http://xmlns.oracle.com/apps/ar/soaprovider/plsql/rest/ar_invoice_api_pub/">
  	<grammars>
  		<include xmlns="http://www.w3.org/2001/XMLSchema" href="https://<hostname>:<port>/webservices/rest/Invoice/?XSD=CREATE_INVOICE_SYNCH_TYPEDEF.xsd" /> 
  	</grammars>
	<resources base="http://<hostname>:<port>/webservices/rest/Invoice/">
		<resource path="/create_invoice/">
			<method id="CREATE_INVOICE" name="POST">
				<request>
					<representation mediaType="application/xml" type="tns1:InputParameters" /> 
					<representation mediaType="application/json" type="tns1:InputParameters" /> 
				</request>
				<response>
					<representation mediaType="application/xml" type="tns1:OutputParameters" /> 
					<representation mediaType="application/json" type="tns1:OutputParameters" /> 
				</response>
			</method>
		</resource>
	</resources>
</application>

If the deployed REST service is an interface type of Java Bean Services or Application Module Services, then both GET and POST can be shown as the supported methods. For example, the following WADL description shows two Java methods contained in the Employee Information service. The getAllReports operation is implemented with GET method, and the getPersonInfo operation is implemented with both POST and GET HTTP methods.

<xml version="1.0" encoding="UTF-8"> 
<application name="EmployeeInfo" targetNamespace="http://xmlns.oracle.com/apps/per/soaprovider/pojo/employeeinfo/"
 xmlns:tns="http://xmlns.oracle.com/apps/per/soaprovider/pojo/employeeinfo/" 
 xmlns="http://wadl.dev.java.net/2009/02" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
 xmlns:tns1="http://xmlns.oracle.com/apps/fnd/rest/empinfo/getallreports/" 
 xmlns:tns2="http://xmlns.oracle.com/apps/fnd/rest/empinfo/getdirectreports/" 
 xmlns:tns3="http://xmlns.oracle.com/apps/fnd/rest/empinfo/getpersoninfo/">

<grammars>
  	...
</grammars>
<resources base="http://<hostname>:<port>/webservices/rest/empinfo/">
  <resource path="/getAllReports/">
	<method id="getAllReports" name="GET">
	   	<request>
			  <param name="ctx_responsibility" type="xsd:string" style="query" required="false" />
           <param name="ctx_respapplication" type="xsd:string" style="query" required="false" />
				<param name="ctx_securitygroup" type="xsd:string" style="query" required="false" />
				<param name="ctx_nlslanguage" type="xsd:string" style="query" required="false" />
				<param name="ctx_orgid" type="xsd:int" style="query" required="false" />
			</request>
			<response>
					<representation mediaType="application/xml" type="tns1:getAllReports_Output" /> 
					<representation mediaType="application/json" type="tns1:getAllReports_Output" /> 
				</response>
			</method>
	</resource> 
 ...
 <resource path="="/getPersonInfo/ {personId}/">
  <param name="personId" style="template" required="true" type="xsd:int" /> 
	<method id="getPersonInfo" name="GET">
	   	<request>
			  <param name="ctx_responsibility" type="xsd:string" style="query" required="false" />
           <param name="ctx_respapplication" type="xsd:string" style="query" required="false" />
				<param name="ctx_securitygroup" type="xsd:string" style="query" required="false" />
				<param name="ctx_nlslanguage" type="xsd:string" style="query" required="false" />
				<param name="ctx_orgid" type="xsd:int" style="query" required="false" />
			</request>
			<response>
					<representation mediaType="application/xml" type="tns3:getPersonInfo_Output" /> 
					<representation mediaType="application/json" type="tns3:getPersonInfo_Output" /> 
				</response>
			</method>
		</resource> 
 <resource path="/getPersonInfo/">
		<method id="getPersonInfo" name="POST">
				<request>
				   <representation mediaType="application/xml" type="tns3:getPersonInfo_Input" /> 
					<representation mediaType="application/xml" type="tns3:getPersonInfo_Output" /> 	
				</request>
		   	<response>
				   <representation mediaType="application/xml" type="tns3:getPersonInfo_Input" /> 
					<representation mediaType="application/xml" type="tns3:getPersonInfo_Output" />
           </response>
			</method>
		</resource>
  </resource path>
</application>

For more information about WADL description, see Reviewing WADL Element Details.

To deploy a REST Web service:

  1. Log in to Oracle E-Business Suite as a user who has the Integration Administrator role. Select the Integrated SOA Gateway responsibility and the Integration Repository link.

  2. In the Integration Repository tab, select 'Interface Type' from the View By drop-down list.

  3. Expand an interface type node to locate your desired interface definition.

  4. Click the interface definition name link to open the interface details page.

  5. In the REST Web Service tab, enter the following information:

  6. Click Deploy to deploy the service to an Oracle E-Business Suite environment.

  7. Click the deployed View WADL link to view the deployed WADL description.