Skip to content

Build Code for the Insert Button Event Handler to Insert a New Course – ORACLE DATABASE PROGRAMMING WITH JAVA

Menu
  • Contact Us
Menu

Add a Web Service Reference to Our Web-Based Project and Change the Ports – Develop Java Web Services to Access Databases

Posted on 2023-05-242024-08-24 by Patricia Carey

9.16.2  Add a Web Service Reference to Our Web-Based Project and Change the Ports

In order to call an operation in our Web service application project, WebAppCourse, we need to add the Web reference in our Web-based client project, WebClientCourse _ Select, to direct all calls to our Web service project. Perform the following operations to add the Web service reference:

1) Build and deploy our Web Service project, WebAppCourse, to make it ready.
2) Right-click on our Web-based client project, WebClientCourse _ Select, and select the New > Web Service Client item to open the New Web Service Client wizard.

3) In the opened wizard, click on the Browse button that is next to the Project field and expand our Web application, WebAppCourse. Then choose our Web service class file, WebServiceCourse, by clicking on it, and click on the OK button.

4) Click on the Finish button to complete the Web service reference addition process.

Prior to building the code for our pages and Java Bean class file, we need first to modify the related Web server HTTP port numbers since currently two Web Servers are utilized for our client projects: GlassFish and Tomcat, and both of them may use the same port to start the service. To avoid any con-flict from a duplicated port number, we need to change some of them to avoid this duplication error. We prefer to keep the HTTP port for the GlassFish server, so we can modify the Tomcat server’s starting HTTP port number. We need to access the default server configuration file of the Tomcat server, server.xml, to do any modifications for those ports. Perform the following operations to enable us to access that configuration file:

1) Open the Windows Explorer and browse to the default location for that configuration file, which is C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.27\conf. Then right-click on the configuration file server.xml, and select the Properties item to open its Properties wizard.

2) Click on the Security tab on the top and the Edit button to open the Permissions wizard. Then click on the Add button to try to add us as Authenticated Users to access that file.
3) In the opened Select Users wizard, click on the Advanced button on the lower-left corner, and click on the Find Now button.
4) Then select Authenticated Users from the list at the bottom and click on the OK button in two times to add it into the Group or user names list.
5) Click Authenticated Users from the list to select it, and check all checkboxes under the Allow column in the Permissions for Authenticated Users at the bottom.
6) Click on the Apply and OK button (in two times) to complete the authentication process.

Now perform the following operations to modify this configuration file:

1) Right-click on the server.xml file and select the Open with Notepad item to open it.

2) Browse to code line 69 on that file, and change the port number from 8080 to 8082 by changing the code: port = “8082” in that line.

3) Go to File and select the Save item to save these changes. Then you can close this file.

One point to be noted is that you must stop and exit the NetBeans IDE 12.0 prior to doing those modifications to the configuration file to make it effective. Those modifications may not be effective or available if the NetBeans IDE is open.

Now that we have added a Web service reference to our Web-based client project, WebClientCourse _ Select, next let’s develop the code in our client project to call Web service operations to perform related course data query actions. The main code concentrates on building the transaction JSP file, CourseProcess.jsp, and Java Managed Bean class file, CourseQuery.java.

We can still use the original code on the course query part in the CourseProcess.jsp page and add code to the Insert, Update and Delete course parts on that page later, solet’s start from our Java Bean class file, CourseQuery.java.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • August 2024
  • April 2024
  • March 2024
  • January 2024
  • September 2023
  • May 2023
  • January 2023
  • October 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • January 2022
  • November 2021
  • September 2021
  • July 2021
  • May 2021
  • March 2021
  • January 2021
June 2025
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Aug    
  • Creating the Catalog Database
  • Creating the Shard Catalog
  • Exams of Oracle
  • GDS Components
  • GDS Restrictions, License, and Compatibility
  • Oracle Certification Exams
  • Oracle Sharding Workshop
  • Build Code for the Insert Button Event Handler to Insert a New Course 2 – Develop Java Web Services to Access Databases
  • Build Code for the Insert Button Event Handler to Insert a New Course – Develop Java Web Services to Access Databases
  • Build Code for the Update Button Method to Update Course Records – Develop Java Web Services to Access Databases
  • Build Code for the Update Button Method to Update Course Records 2 – Develop Java Web Services to Access Databases
  • Build Code for the Delete Button Method to Delete Course Records – Develop Java Web Services to Access Databases
© 2025 Build Code for the Insert Button Event Handler to Insert a New Course – ORACLE DATABASE PROGRAMMING WITH JAVA | Powered by Minimalist Blog