create rest webservice for oracle public api using java class via jdeveloper
TRANSCRIPT
![Page 1: Create rest webservice for oracle public api using java class via jdeveloper](https://reader034.vdocuments.mx/reader034/viewer/2022042604/589bbd6b1a28ab082b8b4f49/html5/thumbnails/1.jpg)
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](https://reader034.vdocuments.mx/reader034/viewer/2022042604/589bbd6b1a28ab082b8b4f49/html5/thumbnails/2.jpg)
Enter Project Name and Select ‘Java’ :
Leave the Defaults:
![Page 3: Create rest webservice for oracle public api using java class via jdeveloper](https://reader034.vdocuments.mx/reader034/viewer/2022042604/589bbd6b1a28ab082b8b4f49/html5/thumbnails/3.jpg)
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](https://reader034.vdocuments.mx/reader034/viewer/2022042604/589bbd6b1a28ab082b8b4f49/html5/thumbnails/4.jpg)
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](https://reader034.vdocuments.mx/reader034/viewer/2022042604/589bbd6b1a28ab082b8b4f49/html5/thumbnails/5.jpg)
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](https://reader034.vdocuments.mx/reader034/viewer/2022042604/589bbd6b1a28ab082b8b4f49/html5/thumbnails/6.jpg)
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](https://reader034.vdocuments.mx/reader034/viewer/2022042604/589bbd6b1a28ab082b8b4f49/html5/thumbnails/7.jpg)
Save your work
Make sure you have no Build-Issues
![Page 8: Create rest webservice for oracle public api using java class via jdeveloper](https://reader034.vdocuments.mx/reader034/viewer/2022042604/589bbd6b1a28ab082b8b4f49/html5/thumbnails/8.jpg)
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](https://reader034.vdocuments.mx/reader034/viewer/2022042604/589bbd6b1a28ab082b8b4f49/html5/thumbnails/9.jpg)
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](https://reader034.vdocuments.mx/reader034/viewer/2022042604/589bbd6b1a28ab082b8b4f49/html5/thumbnails/10.jpg)
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](https://reader034.vdocuments.mx/reader034/viewer/2022042604/589bbd6b1a28ab082b8b4f49/html5/thumbnails/11.jpg)
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](https://reader034.vdocuments.mx/reader034/viewer/2022042604/589bbd6b1a28ab082b8b4f49/html5/thumbnails/12.jpg)
Now verifying in the backend: Interface table record gets picked up
Checking the base table