create rest webservice for oracle public api using java class via jdeveloper

13
Create Custom Application in Jdeveloper Open Jdeveloper 12.1.3.0.0 or 12.2.1.1.0 -File->New->Application or New Application Select Custom Application Enter the Application Name

Upload: shravan-kumar-chelika

Post on 09-Feb-2017

91 views

Category:

Education


3 download

TRANSCRIPT

Page 1: Create rest webservice for oracle public api using java class via jdeveloper

Create Custom Application in Jdeveloper

Open Jdeveloper 12.1.3.0.0 or 12.2.1.1.0 -File->New->Application or New Application

Select Custom Application

Enter the Application Name

Page 2: Create rest webservice for oracle public api using java class via jdeveloper

Enter Project Name and Select ‘Java’ :

Leave the Defaults:

Page 3: Create rest webservice for oracle public api using java class via jdeveloper

Your Application with project would look like below, right click on the Project ‘Inv_API’ and select

New->Java Class

Enter Java Class Name and leave it as default or click on the Main method check box and press Ok

Page 4: Create rest webservice for oracle public api using java class via jdeveloper

Your Java Class would be as below, add the code for invoking Oracle Public API :

Build the code required to call the Oracle Public API

After Adding the code you might see the errors with ‘OracleTypes’

Page 5: Create rest webservice for oracle public api using java class via jdeveloper

Add Libraries to the Project

To get rid of the errors, add the required JAR Files. Right click on the project ‘Inv_API’ and select ‘Project Properties’ and click on ‘Libraries and Classpath’ and then click on ‘Add Library’ and add following libraries

Page 6: Create rest webservice for oracle public api using java class via jdeveloper

Click on ‘Add JAR/Directory’ and add the JAR Files from your local machine

After adding required Jar and library files , click OK

Page 7: Create rest webservice for oracle public api using java class via jdeveloper

Save your work

Make sure you have no Build-Issues

Page 8: Create rest webservice for oracle public api using java class via jdeveloper

Create Rest Webservice

Right click on ‘Rest_Java.java’ file and select ‘Create RESTful Service’, and enter the required information

Page 9: Create rest webservice for oracle public api using java class via jdeveloper

Your application with code would look like below with the annotations added automatically

Save All

Page 10: Create rest webservice for oracle public api using java class via jdeveloper

Running the Integrated Weblogic Server

Right Click on ‘Rest_Java.java’ and select ‘Run’, select ‘JAX-RS Web Service Runner’

Integrated WebLogic Server gets kicked off and the following URL would be generated

Click on the Target URL, HTTP Analyzer Window opens, enter the parameters

Check the Interface table for the Transaction Interface Id

Page 11: Create rest webservice for oracle public api using java class via jdeveloper

After Rest web service is run you should see the record in the base table

Testing Rest Webservice

Click on ‘Send Request’ after entering the parameters

You should see the message if the Rest Webservice is successful

Page 12: Create rest webservice for oracle public api using java class via jdeveloper

Now verifying in the backend: Interface table record gets picked up

Checking the base table