Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ......

44
Exercise 9.6 – Ping MySQL with EGL Web Service By Gilbert Herschberger (http://www.mindspring.com/~gchii/) Date Written : 7 April 2010 Goal In this exercise, we will create “pingmysqlws”, the smallest possible database web service application for an EGL web service. This EGL web service confirms (a) a connection from a web service client to a web service and (b) a connection from a web service to a database. The word “ping” comes from the world of sonar, an electronic device to measure a distance and direction with underwater sound. A “ping” program is available on many operating systems to measure the distance to another host on the network. Best Practice: Deploy early; deploy often. Test an EGL project to make certain that it is deploy-able on the target application server, such as WAS-CE. Detect a configuration error as soon as possible and suspend all other work on the project until it is resolved. In this exercise, we follow this best practice. We deploy an EGL project as soon as possible, even going as far as deploying an empty project. We deploy every step along the way. Series This document is part of an education and training series. Other exercises include: Exercise 3.2 – EGL-CE 1.0 and WAS-CE 2.1. In this exercise, we download and install WebSphere Application Server Community Edition 2.1. Exercise 9.5 - Ping EGL Web Service. In this exercise, we create an EGL web service without a connection to a database. This exercise features EGL Community Edition 1.0 and WebSphere Application Server Community Edition 2.1. Target Runtime Environment The target environment uses the following software: WebSphere Application Server Community Edition 2.1 MySQL 5.1 Target Development Environment In this exercise, the following software is used to develop a web service application. EGL Community Edition 1.0 WebSphere Application Server Community Edition 2.1 IBM WASCE v2.1 Server Adapter MySQL 5.1 Exercise 9.6 - Ping MySQL with EGL Web Service 1

Transcript of Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ......

Page 1: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Exercise 9.6 – Ping MySQL with EGL Web ServiceBy Gilbert Herschberger (http://www.mindspring.com/~gchii/)Date Written : 7 April 2010

GoalIn this exercise, we will create “pingmysqlws”, the smallest possible database web service application for an EGL web service. This EGL web service confirms (a) a connection from a web service client to a web service and (b) a connection from a web service to a database.

The word “ping” comes from the world of sonar, an electronic device to measure a distance and direction with underwater sound. A “ping” program is available on many operating systems to measure the distance to another host on the network.

Best Practice: Deploy early; deploy often. Test an EGL project to make certain that it is deploy-able on the target application server, such as WAS-CE. Detect a configuration error as soon as possible and suspend all other work on the project until it is resolved. In this exercise, we follow this best practice. We deploy an EGL project as soon as possible, even going as far as deploying an empty project. We deploy every step along the way.

SeriesThis document is part of an education and training series. Other exercises include:

● Exercise 3.2 – EGL-CE 1.0 and WAS-CE 2.1. In this exercise, we download and install WebSphere Application Server Community Edition 2.1.

● Exercise 9.5 - Ping EGL Web Service. In this exercise, we create an EGL web service without a connection to a database. This exercise features EGL Community Edition 1.0 and WebSphere Application Server Community Edition 2.1.

Target Runtime EnvironmentThe target environment uses the following software:

● WebSphere Application Server Community Edition 2.1● MySQL 5.1

Target Development EnvironmentIn this exercise, the following software is used to develop a web service application.

● EGL Community Edition 1.0● WebSphere Application Server Community Edition 2.1● IBM WASCE v2.1 Server Adapter● MySQL 5.1

Exercise 9.6 - Ping MySQL with EGL Web Service 1

Page 2: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

About the networkIn our classroom environment, we have two machines on a network.

● Database machine. A remove machine is our database server. In a classroom setting, a database machine is provided by the instructor and shared by all of the students.

● Development machine. A local machine is our development environment. In a classroom setting, each student has their own development machine.

Note: While we created the exercise with two machines in mind, it is quite possible to work through this exercise with all software installed on one machine.

Prerequisites for a database machineA database is stored on a remote machine. Database server software, such as MySQL, enables us to access the data from another machine on the network. The following are prerequisites for a database machine.

1. Install and start MySQL 5.1 server software.

2. Create a database called “lab”.

3. Grant (at least) read privileges to a user ID and set a password.

4. Create a table called “info”. This table has one column, a varchar(20) column called “version”. This table has but one row, where version is equal to “0.0.0.1-mysql51”.

5. A graphical user interface (GUI) is not required.

Note: Administration of MySQL server, such as creating a database and table, is beyond the scope of this tutorial. For an example of creating a table with MySQL command line tools, see also Database Access with EGL Rich UI (http://www-949.ibm.com/software/rational/cafe/docs/DOC-3370).

Prerequisite: Gathering MySQL database server detailsNow that MySQL is installed on a database machine, you'll need to have answers to the following questions about your server and database.

1. What is the host name of the server?

○○ In this exercise, the name of our host is “mysqldb.gchii.org”.

2. MySQL server is listening on which port? The default port is 3306.

○ In this exercise, MySQL server is listening on port 3306.

3. What is your user name and password?

○ In this exercise, our user name is “gilberth”. In a classroom setting, your user name and password is provided by your instructor.

Exercise 9.6 - Ping MySQL with EGL Web Service 2

Page 3: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

4. What is the name of your MySQL database?

○ In this exercise, the name of our database is “lab”. In a classroom setting, the exact name of your database is provided by your instructor.

5. Are you granted permission to access the database? Minimum permission required is read-only.

○ In this exercise, we are granted read access to the “lab” database.

6. Are you granted permission to access the database from another machine?

○ In this exercise, we are granted access from any machine on our local network.

Prerequisites for a development machineThe following are prerequisites for a development machine.

1. Install EGL Community Edition 1.0.

2. Install WebSphere Application Server Community Edition 2.1 and the IBM WASCE v2.1 server adapter. For more details, see also Exercise 3.2 – EGL-CE 1.0 and WAS-CE 2.1. in this series.

3. A graphical user interface (GUI) is required.

Prerequisite: Gathering WAS-CE server detailsNow that WAS-CE is installed on a database machine, you'll need to have answers to answer the following questions about your application server.

1. What is the administrator user name and password? The default administrator user name is “system”. The default password is “manager”.

2. What is the port number for HTTP? The default port for WAS-CE is 8080.

Exercise overviewThis exercise has multiple parts.

A. Creating a Database Pool. We focus on the configuration of the application server. We create a database pool for WAS-CE.

B. Creating an EGL Web Application. We create a web application from an EGL Project and deploy it to an application server.

C. Adding a Database Connection. We focus on the database configuration of our web application and IDE.

D. Creating an EGL Web Service. Finally, we create the smallest possible EGL web service that uses a database pool.

Exercise 9.6 - Ping MySQL with EGL Web Service 3

Page 4: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Part A: Creating a Database PoolIn this part, let's concentrate on the configuration of WAS-CE, our application server. We will create a database pool using the WAS-CE administrative console. The database pool connects to a MySQL database called “lab”.

1. Starting your IDE.

2. Preparing your workspace.

3. Starting the WAS-CE server.

4. Installing the JDBC driver for MySQL in WAS-CE.

5. Creating a Database Pool in WAS-CE.

Procedure A1: Starting your IDEThe following procedure illustrates how to start your IDE.

1. Start your interactive development environment (IDE).

(a) For Microsoft Windows, double-click the EGL-CE 1.0 ( ) icon on your Windows desktop to start your IDE.

(b) Switch to the “eglws” (EGL Web Services) workspace.

(c) For Microsoft Windows, type “C:\lab\eglws” in the directory field.

(d) Press the OK button.

Exercise 9.6 - Ping MySQL with EGL Web Service 4

Page 5: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Procedure A2: Preparing your workspaceThe following procedure illustrates how to prepare your workspace.

1. Close the Welcome view, if necessary.

(a) Press the Close (X) icon on the Welcome view tab.

2. Switch to the EGL perspective, if necessary.

3. In preferences for your workspace, EGL Services Port must match the HTTP port for WAS-CE.

(a) Pull down the Windows menu and select the Preferences option.

(b) Expand the EGL folder.

(c) Select the Services folder.

(d) Type the port number in the Port field. (Hint: The default for WAS-CE is 8080.)

(e) Press the OK button.

Exercise 9.6 - Ping MySQL with EGL Web Service 5

Page 6: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

4. Confirm the Build Automatically feature is enabled.

5. Switch to the Servers view. The Servers view displays a list of servers used by projects in this workspace. Confirm the Servers view now shows a document for IBM WASCE v2.1 Server at localhost as shown. If not, please see Exercise 3.2 – EGL-CE 1.0 and WAS-CE 2.1 in this series for more information on the download and installation of WAS-CE and its server adapter.

6. In this server document, confirm the Publish Automatically feature has been disabled. For WAS-CE, it is important not want to publish it when it is only partially configured. We want to manually control publishing for our enterprise application only after it is fully configured.

(a) Right-click on the “IBM WASCE v2.1 Server at localhost” document and select the Open option.

(b) In the Publish Automatically section, select the Never Publish Automatically option.

(c) Save the document.

Exercise 9.6 - Ping MySQL with EGL Web Service 6

Page 7: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Procedure A3: Starting the WAS-CE serverThe following procedure illustrates how to start a server, using WAS-CE as an example.

1. Start your IDE.

2. Switch to the EGL perspective.

3. From the Servers view, select the server called “IBM WASCE v2.1 Server at localhost”.

4. Press the Start ( )icon.

Result 1: The Start icon starts a launcher.

Result 2: In turn, the launcher starts WAS-CE.

Result 3: The Servers view displays Started and Synchronized.

● Best Practice: Until WAS-CE starts, do not proceed with your development project. Do not import a WASCE-dependent project from a Project Interchange File.

Procedure A4: Installing JDBC driver for MySQL in WAS-CEThe JDBC driver for MySQL must be installed twice, once for WAS-CE and again for your IDE. The following procedure illustrates how to install the JDBC driver for WAS-CE.

1. Start your IDE.

2. Switch to the EGL perspective, if necessary.

3. Start the WAS-CE server.

4. In the Servers view, right-click on the “IBM WASCE v2.1 Server at localhost” document and select the Launch WASCE Console option.

Result: In a browser window, the IBM WASCE v2.1 Server at localhost Console page is displayed.

5. Fill in the Log in to the Administrative Console form.

Exercise 9.6 - Ping MySQL with EGL Web Service 7

Page 8: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

(a) Type your WAS-CE administrator user name in the Username field.

Hint: The default administrator user name is “system”.

(b) Type your WAS-CE administrator password in the Password field.

Hint: The default administrator password is “manager”.

(c) Press the Login button.

Result: The Welcome page is displayed.

6. In the Console Navigation view, in the Services folder, click the Repository link.

Result: The Repository Viewer page is displayed.

7. Press the Browse button.

Result: The Choose file dialog box is displayed.

Exercise 9.6 - Ping MySQL with EGL Web Service 8

Page 9: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

8. Fill in the Choose file dialog box.

(a) Navigate to the “lab/jdbc” folder.

(b) Select the “mysql-connector-java-5.1.7-bin.jar” file.

(c) Press the Open button.

Result: The Repository Viewer page is displayed.

Exercise 9.6 - Ping MySQL with EGL Web Service 9

Page 10: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

9. Fill in the Add Archive to Repository form of the Repository Viewer page.

(a) Confirm the File field.

(b) Type “mysql” in the Group field.

(c) Confirm the Artifact field is “mysql-connector-java”.

(d) Confirm the Version field is “5.1.7-bin”.

(e) Confirm the Type is “jar.

(f) Press the Install button.

Result 1: The MySQL Connector/JDBC 5.1.7 is added to the WAS-CE repository.

Result 2: The Repository View page is displayed.

10.Confirm that “mysql/mysql-connector-java/5.1.7-bin/jar” is added to the repository.

Hint: Scroll down, if necessary. Entries are in alphabetical order.

11.Log out of the administrative console for WAS-CE.

(a) Click the Logout link.

Result: The Log in to the Administrative Console page is displayed (again).

12.Close the IBM WASCE v2.1 Server at localhost Console window.

Procedure A5: Creating a Database Pool in WAS-CEWe choose to use the administrative console to create a database pool in WAS-CE to separate the configuration of the database connection from the configuration of the enterprise application. Once we have proven a connection from WAS-CE to MySQL, we can go on to configure a connection pool inside an enterprise application. The following procedure illustrates how to create a database pool in WAS-CE for the “lab” database in MySQL.

1. Start your IDE.

2. Switch to the EGL perspective, if necessary.

3. Start the WAS-CE server.

4. In the Servers view, right-click on the “IBM WASCE v2.1 Server at localhost” document and select the Launch WASCE Console option.

Exercise 9.6 - Ping MySQL with EGL Web Service 10

Page 11: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Result: In a browser window, the IBM WASCE v2.1 Server at localhost Console page is displayed.

5. Fill in the Log in to the Administrative Console form.

(a) Type your WAS-CE administrator user name in the Username field.

(b) Type your WAS-CE administrator password in the Password field.

(c) Press the Login button.

Result: The Welcome page is displayed.

6. In the Console Navigation view, in the Services folder, click the Database Pools link.

Result: The Database Pools page is displayed.

7. To create a new database pool, click “Using the Geronimo database pool wizard”.

Result: The Create Database Pool page is displayed.

8. Fill in the Select Name and Database step of the Create Database Pool wizard.

(a) Type “jdbc/labpool” in the Name of Database Pool field.

(b) Select the MySQL option in the Database Type field.

(c) Press the Next button.

Result: The second page is displayed.

9. Fill in the second page of the Create Database Pool wizard.

(a) Confirm the Name of Database Pool field is “jdbc/labpool”.

(b) Confirm the Pool Type is “TranQL Client Local Transaction Resource Adapter for MySQL”.

Exercise 9.6 - Ping MySQL with EGL Web Service 11

Page 12: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

(c) Fill in the Basic Connection Properties section.

i. Select the “mysql/mysql-connector-java/5.1.7-bin/jar” option in the Driver JAR field.

ii. Type “lab” in the Database Name field.

iii. Type your MySQL user name in the User Name field. In this example, our MySQL user name is “gilberth”.

iv. Type your MySQL password in the Password field.

v. Type your MySQL password (again) in the Confirm Password field.

vi. Type the host name of the MySQL server in the Server Name field. In this example, our MySQL host name is “mysqldb.gchii.org”.

vii.Type the MySQL port in the Port Number field. In this example, our port number is “3306”.

Exercise 9.6 - Ping MySQL with EGL Web Service 12

Page 13: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

(d) Fill in the Connection Pool Parameters section of the form.

i. Confirm the Transaction Type field is “LOCAL”.

ii. Confirm the Pool Min Size is blank.

iii. Confirm the Pool Max Size is blank.

iv. Confirm the Blocking Timeout is blank.

v. Confirm the Idle Timeout is blank.

(e) Press the Deploy button.

Result 1: The “jdbc/labpool” database pool is created.

Result 2: The Database Pools page is displayed.

10.To confirm the connection from WAS-CE to MySQL, let's run a simple SQL query.

(a) In the Run SQL view of the Database Pools page, select “jdbc/labpool” option in the Use DataSource field.

(b) Type “select * from info” in the SQL Command/s field.

(c) Press the Run SQL button.

Result 1: The SQL query is run on MySQL.

Result 2: The results are displayed in the Run SQL view.

Exercise 9.6 - Ping MySQL with EGL Web Service 13

Page 14: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

11.For more information about how to configure a database application to deploy on WAS-CE, see also the Usage page for the pool.

(a) Find the row for the “jdbc/labpool” database pool and click on its Usage link.

12.Log out of the administrative console for WAS-CE.

(a) Click the Logout link.

13.Close the IBM WASCE v2.1 Server at localhost Console window.

Milestone AHere is a review of what we have accomplished so far.

● The JDBC driver for MySQL is installed in WAS-CE.● A Database Pool called “jdbc/labpool” is created in WAS-CE.● Best Practice: Test a connection to a database with a JDBC driver and database pool in the

administrative console of WAS-CE before installing a web application having a connection plan with a dependency on a JDBC driver.

Exercise 9.6 - Ping MySQL with EGL Web Service 14

Page 15: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Part B: Creating an EGL Web ApplicationWe have been working with WAS-CE to create a database pool called “jdbc/labpool”. Now we turn our attention to creating a web application with EGL. The web application displays a static page. It uses neither a database connection nor a web service.

1. Creating an EGL Project.

2. Deploying an EGL Project.

3. Adding an HTML document.

4. Testing with “Run on Server”

Procedure B1: Creating an EGL ProjectAn EGL Project is a first step toward a EGL web service project. The following procedure illustrates how to create an EGL Project called “pingmysqlrui”.

1. Pull down the File menu on the menu bar and select New | EGL Project option.

Result: The New EGL Project wizard is displayed.

2. Fill out the New EGL Project page of the New EGL Project wizard.

(a) Type “pingmysqlrui” in the Name field.(b) Confirm that the Use default location field is checked.

(c) Press the Next button.

Result: The EGL Settings page is displayed.

Exercise 9.6 - Ping MySQL with EGL Web Service 15

Page 16: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

3. Fill out the EGL Settings page of the New EGL Project wizard.

(a) Confirm the “com.ibm.egl.rui_1.0.2” project is checked.

(b) Uncheck the “com.ibm.egl.rui.dojo.runtime.google_1.3.2” project.

(c) Press the Finish button.

Result: The “pingmysqlrui” EGL Project is created.

Procedure B2: Deploying an EGL ProjectWe deploy an empty EGL project to create a deployment plan for WAS-CE. The following procedure illustrates how to deploy an EGL Project, creating a web application.

1. Right-click on the “pingmysqlrui” project and select the Deploy EGL Project option.

Result: The EGL Deployment dialog box is displayed.

Exercise 9.6 - Ping MySQL with EGL Web Service 16

Page 17: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

2. Press the Yes button.

Result: The EGL deployment descriptor is displayed.

3. Press the New button.

Result: The New Dynamic Web Project wizard is displayed.

4. Fill out the Dynamic Web Project page of the New Dynamic Web Project wizard.

(a) Type “pingmysqlws” in the Project name field.

(b) Confirm the Use default field is checked.

(c) Confirm the Target Runtime field is “IBM WASCE v2.1”.

(d) Confirm the Dynamic Web Module version field is “2.5”.

Exercise 9.6 - Ping MySQL with EGL Web Service 17

Page 18: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

(e) Confirm the Configuration field is “Default Configuration for IBM WASCE v2.1”.

(f) Confirm the Add project to an EAR is checked.

(g) Confirm the EAR Project Name field is “pingwsEAR”.

(h) Press the Next button.

Result: The Web Module page is displayed.

5. Fill in the Web Module page of the New Dynamic Web Project wizard.

(a) Confirm the Context Root field is “pingws”.

(b) Confirm the Content Directory field is “WebContent”.

(c) Confirm the Java Source Directory is “src”.

(d) Confirm the Generate deployment descriptor field is checked.

(e) Press the Next button.

Result: The Geronimo Deployment Plan page is displayed.

Exercise 9.6 - Ping MySQL with EGL Web Service 18

Page 19: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

6. Fill in the Geronimo Deployment Plan page of the New Dynamic Web Project wizard.

(a) Type “lab” in the Group Id field.

(b) Type “pingmysqlws” in the Artifact Id field.

(c) Type “0.0.0.1” in the Version field.

(d) Confirm the Artifact Type is “car”.

(e) Confirm the Add a runtime dependency to Geronimo's shared library field is unchecked.

(f) Press the Finish button.

Result 1: The “pingmysqlws” project is created.

Result 2: The “pingmysqlwsEAR” project is created.

Result 3: The EGL deployment descriptor is displayed.

7. Save “pingmysqlrui.egldd”, the EGL deployment descriptor.

Exercise 9.6 - Ping MySQL with EGL Web Service 19

Page 20: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

8. Update the “geronimo-application.xml” file.

(a) In the Project Explorer view, expand the “pingmysqlwsEAR” project.

(b) Expand the META-INF folder.

(c) Open the “geronimo-application.xml” document.

Result: The General tab of the Geronimo Deployment Plan Editor is displayed.

(d) Type “lab” in the Group Id field.

(e) Confirm the Artifact Id field is “pingmysqlwsEAR”.

(f) Type “0.0.0.1” in the Version field.

(g) Confirm the Artifact Type field is “car”.

(h) Save the file.

9. Right-click the “pingmysqlrui” project and select the Deploy EGL Project option (again).

Result 1: The “pingmysqlrui” project is deployed to the “pingmysqlws” project.

Result 2: The “pingmysqlwsEAR” project is published to WAS-CE.

Result 3: The server status is Synchronized.

Exercise 9.6 - Ping MySQL with EGL Web Service 20

Page 21: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Procedure B3: Adding an HTML documentWhen this step has been completed, the “index.html” file contains the following lines of code.

<html><head><title>pingmysqlrui</title></head><body><h1>pingmysqlrui</h1><a href="services/PingWS">PingWS</a><a href="services/PingWS?WSDL">WSDL</a></body></html>

The following procedure illustrates how to add an HTML document to our EGL Rich UI project.

1. Start your IDE.

2. Switch to the EGL perspective, if necessary.

3. In the Project Explorer view, expand the “pingmysqlws” project.

4. Right-click on the WebContent folder and select the New | File option.

Result: The New File wizard is displayed.

Exercise 9.6 - Ping MySQL with EGL Web Service 21

Page 22: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

5. Fill in the File page of the New File wizard.

(a) Confirm the Enter or select parent folder field is “pingmysqlws/WebContent”.

(b) Type “index.html” in the File name field.

(c) Press the Finish button.

Result: The “index.html” document is created and opened in an editor.

6. Type the source code (above) for the “index.html” file.

7. Save the file.

Procedure B4: Testing with “Run on Server”The following procedure illustrates how to test a web application with the “Run on Server” technique.

1. Start your IDE.

2. Switch to the EGL perspective, if necessary.

3. Start the WAS-CE server.

4. In the Project Explorer view, right-click on the “pingmysqlws” project and select the Run As | Run on Server option.

5. Result: The Run On Server wizard is displayed.

Exercise 9.6 - Ping MySQL with EGL Web Service 22

Page 23: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

6. Fill in the Run On Server page of the Run On Server wizard.

(a) Confirm the How do you want to select the server? field is “Choose an existing server”.

(b) Confirm the Select the server that you want to use field is “IBM WASCE v2.1 Server at localhost”.

(c) Check the Always use this server when running this project option.

(d) Press the Finish button.

Result: The welcome page (“index.html”) is displayed.

Exercise 9.6 - Ping MySQL with EGL Web Service 23

Page 24: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Milestone BHere is a summary of what we have accomplished.

● A Database Pool called “jdbc/labpool” is created in WAS-CE.● A web application is deployed to WAS-CE. It does not yet use a database connection. It does

not yet contain an EGL web service.● A welcome page is displayed with “Run on Server”.

○ The PingWS link does not yet work.○ The WSDL link does not yet work.

● Best Practice: Confirm your empty EGL project deploys to WAS-CE before you proceed with further development.

Exercise 9.6 - Ping MySQL with EGL Web Service 24

Page 25: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Part C: Connecting to a DatabaseLet's turn our attention to preliminary database configuration. To keep our web application always deploy-able, we connect to a database in two parts. In this, the first part, we prepare our web application and IDE to use a database, but deploy our web application without it. Using a database must wait until the next part, Part D.

1. Preparing a web application. In this step, we prepare our web application to use a database pool.2. Preparing an IDE. In this step, we prepare our IDE to use a database connection.

Caution: Do not put off deploying your application until the end of part D. Something might go wrong. Waiting can make troubleshooting more difficult, if not impossible.

Procedure C1: Preparing a web applicationOpening a connection to a database using a database pool is an optional feature provided by the Geronimo application server (and WAS-CE). To open a connection to a database pool, our web application uses this feature. In other words, it depends upon the feature. In this step, we learn to declare a dependency on the database pool feature.

A database pool is managed by an application server, such as WAS-CE. In other words, it is a resource of the application server. In this step, we learn to link a resource reference (used within a web application) to a resource (managed by an application server).

The following procedure illustrates how to update the Geronimo Deployment Plan to declare a dependency on a database pool and linking a resource reference to a resource.

1. Start your IDE.

2. Switch to the EGL perspective.

3. Start the WAS-CE server.

4. In the Project Explorer view, expand the “pingmysqlws” project.

5. Expand the WebContent folder.

6. Expand the WEB-INF folder.

7. Open the “geronimo-web.xml” document with the Geronimo Deployment Plan editor.

Hint: We use the Geronimo mechanism for deployment to WAS-CE.

Result: The “geronimo-web.xml” document is displayed in the Geronimo Deployment Plan editor.

8. Switch to the Deployment tab.

9. Expand the Server Dependencies section.

10.Press the Add button.

Result: The New Dependency dialog box is displayed.

Exercise 9.6 - Ping MySQL with EGL Web Service 25

Page 26: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

11.Fill in the New Dependency dialog box.

(a) Type “console.dbpool” in the Group Id field. Every database pool has the same group ID.

(b) Type “jdbc_labpool” in the Artifact Id field. An artifact ID cannot contain certain characters, such as the forward slash (/). As explained in its Usage page, “jdbc_labpool” is the artifact ID dependency for the “jdbc/labpool” database pool created with procedure A5.

(c) Confirm the Version field is blank.

(d) Confirm the Artifact field is blank.

(e) Press the Finish button.

Result: A dependency is added to the deployment plan. Now, our web application can use the database pool feature.

12.Switch to the Naming tab.

13.Expand the Resource References section

14.Press the Add button.

Result: The Resource Reference Details dialog box is displayed.

Exercise 9.6 - Ping MySQL with EGL Web Service 26

Page 27: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

15.Fill in the Resource References Details dialog box.

(a) Type “jdbc/lab” in the Reference Name field.

(b) Type “jdbc/labpool” in the Resource Link field.

(c) Press the Finish button.

Result: The JNDI name called “jdbc/lab” is defined for the web application. It is a link to the database pool called “jdbc/labpool”, which was created during procedure A5.

16.Save the document.

17.Test with “Run on Server”.

Result 1: Our web application is published without errors to WAS-CE.

Result 2: The welcome page is displayed.

Exercise 9.6 - Ping MySQL with EGL Web Service 27

Page 28: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Procedure C2: Preparing an IDEConnecting your IDE to a database is an important step in the development of an application that connects to a database. The following procedure illustrates how to test your database connection, using MySQL as an example.

1. Start your IDE.

2. Switch to the Database Development perspective.

3. From the Data Source Explorer view, right-click on on the Database Connections folder and select the New option.

Result: The New Connection Profile wizard is displayed.

4. Fill in the Connection Profile page of the New Connection Profile wizard.

(a) Select MySQL in the Connection Profile Types field.

(b) Type “lab” in the Name field.

(c) Type a description in the Description field.

(d) Press the Next button.

Result: The Specify a Driver and Connection Details page is displayed.

5. Press the New Driver Definition ( ) icon.

Exercise 9.6 - Ping MySQL with EGL Web Service 28

Page 29: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Result: The New Driver Definition dialog box is displayed.

6. Fill in the New Driver Definition dialog box.

(a) In the Name/Type tab, select the MySQL JDBC Driver 5.1.

(b) Switch to the Jar Lib tab.

(c) Select the “mysql-connector-java-5.1.0-bin.jar” in the Driver files field.

(d) Press the Edit JAR/Zip button.

Result: The Select the file: dialog box is displayed.

(e) Navigate to the lab/jdbc directory.

(f) Select the “mysql-connector-java-5.1.0-bin.jar” file.

(g) Press the Open button.

Result: The New Driver Definition dialog box is displayed.

(h) Confirm the Jar List tab.

i. For Microsoft Windows, confirm the Drivers files field contains one jar called “C:\lab\jdbc\mysql-connector-java-5.1.7-bin.jar”.

ii. Switch to the Name/Type tab.

Exercise 9.6 - Ping MySQL with EGL Web Service 29

Page 30: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

(i) Confirm the Name/Type tab.

i. Confirm the Available driver templates field is MySQL JDBC Driver version 5.1.

ii. Confirm the Driver name field is “MySQL JDBC Driver”.

iii. Confirm the Driver type field is “MySQL JDBC Driver”.

iv. Press the OK button.

Result: The New Connection Profile wizard is displayed.

Exercise 9.6 - Ping MySQL with EGL Web Service 30

Page 31: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

7. Fill in the Specify a Driver and Connection Details page of the New Connection Profile wizard.

(a) Type “lab” in the Database field.

(b) Type “jdbc:mysql://mysqldb.gchii.org:3306/lab” in the URL field.

(c) Type your MySQL user name in the User name field.

(d) Type your MySQL password in the Password field.

(e) Check the Save password option.

(f) Confirm the Connect when wizard completes field option is checked.

(g) Confirm the Connect every time the workbench is started option is unchecked.

Exercise 9.6 - Ping MySQL with EGL Web Service 31

Page 32: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

(h) Press the Test Connection button.

Result A: The Success dialog box is displayed.

A. Press the OK button.

Result B: The Error dialog box is displayed.

A. Press the Details button.

B. Communications link failure. This message means that you are not able to connect to the MySQL database. Resolve the connection between your machine and your MySQL database and try again (return to step h above).

Hint 1: Check the connection between your machine and the network. Your computer must be connected to a network to use a MySQL database on another host.

Hint 2: Confirm the host name is reachable for the MySQL database server. The host name, such as “mysqldb.gchii.org” in this example, must be reachable. If the host name is correct, check the IP address. Add a DNS entry to your network or entry in your hosts file for the machine name.

Hint 3: Confirm the MySQL server is started. The database server must be running.

Hint 4: Check the port configuration for MySQL server. By default, MySQL server listens on port 3306.

Hint 5: The firewall rules on the machine where the database server is running must allow TCP/IP traffic on the MySQL server port from the local network. Modify the firewall rules to allow local network access to the MySQL server port.

C. Access denied for user 'n'@'%' to database 'd'. When you see this message, it means that you are able to connect to the MySQL database, but you have not yet been granted privileges. You may not have been granted privileges to the database, such as “lab”. Or, you may not have been granted privileges to access the database from another host. From the MySQL administration console, grant privileges and try again. MySQL administration is beyond the scope of this document.

Exercise 9.6 - Ping MySQL with EGL Web Service 32

Page 33: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

(i) Press the Next button.

Result: The Summary page is displayed.

8. Fill in the Summary page of the New Connection Profile wizard.

(a) Press the Finish button.

Result 1: A connection profile called “lab” is created.

Result 2: Your IDE opens a connection to the lab database.

Exercise 9.6 - Ping MySQL with EGL Web Service 33

Page 34: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

9. Explore the lab connection.

(a) Expand the “lab” database.

Hint: Look for the database ( ) icon.

(b) Expand the Schemas folder.

(c) Expand the “lab” schema.

Hint: Look for the schema ( ) icon.

(d) Expand the Tables folder. (In this example, there is one table called “info”.)

(e) Expand the “info” table.

Hint: Look for the table ( ) icon.

(f) Expand the Views folder. (In this example, there are no views.)

Milestone CAt this point in the exercise, we have laid the ground work for creating an EGL web service with access to a database.

● A Database Pool called “jdbc/labpool” is created in WAS-CE.● A web application is deployed to WAS-CE. It is prepared to use a database connection.● On a welcome page displayed with “Run on Server”, the PingWS and WSDL links still do not

work.● Our IDE is prepared to use a database connection.● Best Practice: Test your JDBC driver and connection with Data Source Explorer before loading

database options using the connection in an EGL Build Descriptor.

Exercise 9.6 - Ping MySQL with EGL Web Service 34

Page 35: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Part D: Creating an EGL Web ServiceIn this part, we start and end with a working web application.

1. Updating the EGL Build Descriptor.

2. Creating an EGL web service.

3. Adding an operation called “getVersion”.

4. Testing with Web Services Explorer.

5. Reducing web deployment descriptor

6. Removing files

7. Exporting an EAR file.

Procedure D1: Updating the EGL Build DescriptorThe following procedure illustrates how to update the database-related settings in an EGL Build Descriptor, using “pingmysqlrui.eglbld” as an example.

1. Start your IDE.

2. Switch to the EGL perspective.

3. In the Project Explorer, expand the “pingmysqlrui” project.

4. Expand the EGL Source folder.

5. Open “pingmysqlrui.eglbld”, the EGL Build Descriptor.

6. Select the “lab” option from the Load DB options using connection field. When preparing our IDE with procedure C2, we created and tested a database connection called “lab”.

7. Type “jdbc/lab” in the sqlJNDIName option. The tooling declares this resource reference for our web application every time we deploy an EGL Project. It is not necessary to edit the web deployment descriptor (“web.xml”).

Caution: On the other hand, the tooling does not add a prerequisite link from a resource reference to a resource. When preparing our web application with procedure C1, we manually added a link to the Geronimo Deployment Plan (“geronimo-web.xml”).

8. Save the file.

9. Deploy the “pingmysqlrui” project to “pingmysqlws”.

Result: The project is deployed and published to WAS-CE without errors.

Procedure D2: Creating an EGL Web ServiceThe following procedure illustrates how to create an EGL web service.

1. Start your IDE. 2. Switch to the EGL perspective.

Exercise 9.6 - Ping MySQL with EGL Web Service 35

Page 36: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

3. Start the WAS-CE server. 4. Create an EGL package called “services.pingmysql”.

(a) Switch to the EGL Project view.(b) Expand the “pingmysqlrui” project.(c) Right-click on the EGL Source folder and select the New | Package option.

Result: The New Package wizard is displayed.(d) Fill out the EGL Package page of the New EGL Package wizard.

i. Confirm the Source folder field is “pingmysqlrui\EGLSource”. ii. Type “services.pingmysql” in the Package name field. iii. Press the Finish button.

Result: The “services.pingmysql” package is created. 5. Create a web service.

(a) Expand the EGL Source folder.(b) Right-click on the “services.pingmysql” package and select the New | Service option.

Result: The New EGL Service Part wizard is displayed.

Exercise 9.6 - Ping MySQL with EGL Web Service 36

Page 37: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

6. Fill out the New EGL Service Part page of the New EGL Service Part wizard as shown.

i. Confirm the Source folder field is “pingmysqlrui\EGLSource”. ii. Confirm the Package field is “services.pingmysql”. iii. Type “PingWS” in the EGL source file name field. iv. Check the Create as Web (SOAP) service option. v. Press Finish button.

Result 1: The PingWS.egl source file is created and opened in the EGL source code editor.Result 2: The PingWS web service is added to the EGL build descriptor.

Exercise 9.6 - Ping MySQL with EGL Web Service 37

Page 38: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Procedure D3: Adding an operation called “getVersion”The “getVersion” operation gets a version from the first record a table called “info”. It gets all rows from the table and returns the value from the version column of the first record. When this step has been completed, the “PingWS.egl” file contains the following lines of code.

package services.pingmysql;// serviceservice PingWS

// Variable Declarations// variableName string;

// Function Declarations// function functionName()// end

function getVersion() returns (string)records info[];get records;return (records[1].version);

endendrecord info type SQLRecord {tableNames = [["info"]]}

version string {column="version", sqlVariableLen=yes, maxLen=20};end

The following procedure illustrates how to edit the source code for an EGL service, using PingWS.egl as an example.

1. Start your IDE. 2. Switch to the EGL perspective. 3. Start the WAS-CE server. 4. In the Project Explorer view, expand the “pingmysqlrui” project. 5. Expand the EGL Source folder. 6. Expand the “services.pingmysql” package. 7. Double-click on the PingWS.egl file.

Result: The PingWS.egl is opened in the EGL source code editor. 8. Edit the source code for the “PingWS.egl” file to match the listing above. 9. Save the file. 10.Deploy “pingmysqlrui”, the EGL Project.

Result: The project is deployed and published to WAS-CE without errors.

Exercise 9.6 - Ping MySQL with EGL Web Service 38

Page 39: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

11.Test with “Run on Server”.

(a) Display the web service page.

i. Click on the PingWS link. ii. Or, open your favorite web browser to the following location:

“http://localhost:8080/pingmysqlws/services/PingWS”.(b) Ask a service for its WSDL file.

i. Click on the WSDL link. ii. Or, open your favorite web browser to the following location:

“http://localhost:8080/pingmysqlws/services/PingWS”.

Exercise 9.6 - Ping MySQL with EGL Web Service 39

Page 40: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Procedure D4: Testing with Web Services Explorer.The following procedure illustrates how to test an EGL web service with the Web Services Explorer.

1. In the Project Explorer view, expand the “pingmysqlws” project.

2. Expand the WebContent folder.

3. Expand the WEB-INF folder.

4. Expand the wsdl folder.

5. Right-click the PingWS web service definition (“PingWS.wsdl”) and select the Web Services | Test with Web Services Explorer option.

Result: The Web Services Explorer is displayed.

6. Confirm the endpoint is “http://localhost:8080/pingmysqlws/services/PingWS”.

7. In the Actions tab, click the “getVersion” operation.

Result: The Invoke a WSDL Operation page is displayed.

8. Press the Go button.

Result 1: The getVersion operation of the PingWS web service is invoked.

Exercise 9.6 - Ping MySQL with EGL Web Service 40

Page 41: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Result 2: The result is displayed in the Status tab.

9. Confirm that the Status tab contains the getVersionResponse of “0.0.0.1-mysql51”.

10. Network is unreachable: connect. This message indicates that Web Services Explorer sent a request and there was no response from the WAS-CE server.

Hint 1: The WAS-CE server is stopped. Start it.

Hint 2: The endpoint is incorrect, such as the wrong port. Correct the port setting in the EGL | Service folder of workspace preferences and deploy the EGL project again.

11. Not Found. The following message indicates that Web Services Explorer sent a request and WAS-CE responded with page not found (HTTP 404).

Hint 1: The endpoint is incorrect, such as the wrong context. In this example, the path for the web service is “pingmysqlws/services/PingWS”, not “pingmysqlrui/services/PingWS”.

Hint 2: The Axis servlet or “/services/*” servlet mapping is missing from the web deployment descriptor (“web.xml”).

Exercise 9.6 - Ping MySQL with EGL Web Service 41

Page 42: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Procedure D5: Reducing web deployment descriptorServlets, filters, security roles, security constraints, welcome pages, context parameters and tag libraries are declared in a web deployment descriptor. The following procedure illustrates how to remove unneeded references from a web deployment descriptor.

1. In the Project Explorer view, expand the “pingmysqlws” project.

2. Expand the WebContent folder.

3. Double-click on “Deployment Descriptor: pingmysqlws” to open the web deployment descriptor, “web.xml”. This document is not the EGL Deployment Descriptor.

Result: The web deployment descriptor for the project is displayed.

4. About Welcome Pages. An EGL web service project does not depend upon welcome pages. We can safely remove them.

(a) In this example, we remove all welcome pages except for index.html because we created an index.html document to summarize your web service project.

5. About Servlets. An EGL web service project for Tomcat depends upon Apache Axis. However, it does not depend upon the Axis Admin Servlet. We may remove the Axis Admin Servlet and the “/servlet/AdminServlet” mapping.

It does not depend upon EGL Rich UI Proxy. We may remove the EGLRichUIProxy servlet and the “/__proxy” mapping.

6. About Servlet Mappings. An EGL web service project for Tomcat depends upon the “/services/*” mapping. However, it does not depend upon the “/servlet/AxisServlet” and “*.jws” mapping. We may remove them.

7. About filters. An EGL web service project does not depend upon filters. We may remove the CompressionFilter filter and filter mappings.

8. Press the Save icon.

Procedure D6: Removing filesAt this point, we have a pure web services application because we did not create an EGL Rich UI handler. But what happens in a web services project when we create at least one handler and forget to uncheck the Deploy All Rich UI Handlers setting in the EGL Deployment Descriptor? The deploy process creates files that an EGL web service application does not use.

Caution: When deploying an EGL project, there is no undo button.

For more information, see also Exercise 9.5 – Ping EGL Web Service in this series.

Exercise 9.6 - Ping MySQL with EGL Web Service 42

Page 43: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Procedure D7: Exporting an EAR fileThe following procedure illustrates how to export an EAR file for WAS-CE, using the “pingmysqlwsEAR” enterprise application project as an example.

1. Start your IDE.

2. Switch to the EGL perspective.

3. In the Project Explorer view, right-click on the “pingmysqlwsEAR” project and select the Export | EAR File option.

Result: The Export wizard is displayed.

4. Fill in the page of the Export wizard as shown.

(a) Confirm the EAR project field is “pingmysqlwsEAR”.

(b) Type “C:\lab\pingmysqlwsEAR.ear” in the Destination field.

(c) Confirm the Optimize for a specific server runtime is checked.

(d) Confirm the Target Runtime field is “IBM WASCE v2.1”.

(e) Confirm the Export source files field is unchecked.

(f) Check the Overwrite existing file field.

(g) Press the Finish button.

Result: The web service project is exported to an enterprise application archive (EAR) file.

Exercise 9.6 - Ping MySQL with EGL Web Service 43

Page 44: Exercise 9.6 – Ping MySQL with EGL Web Service · Note: Administration of MySQL server, ... select the Launch WASCE Console option. ... Ping MySQL with EGL Web Service 8.

Production System – First StepsIn a production environment, the “pingmysqlws” web service application confirms a connection (a) from a web service client to a web service and (b) from a web service to a database. It can be used by your web service client to confirm a connection to the web server and the version of the database before invoking any other web service.

This application can be the first EGL web service installed in a production system. Install it early in an EGL web service project to identify and resolve any problems with a production environment. This is part of a general troubleshooting strategy.

In general, the following steps are used.

1. Install and start the “pingmysqlwsEAR.ear” enterprise application. Likely, you will use the Administrative Console of the target instance of WAS-CE to install a web application from “pingmysqlwsEAR.ear”. The exact procedure required to deploy an enterprise application on WAS-CE belongs to you. It is beyond the scope of this document.

2. Test with Web Services Explorer. Obtain a WSDL document from the production web service using the standard “?WSDL” suffix. For our exercise, the WSDL document is found at “http://localhost:8080/pingmysqlws/services/PingWS?WSDL”. Substitute “localhost:8080” with a production host and port.

3. Generate your web service client from the WSDL. Many web service clients are available. The only web service client that needs to be tested is the one that you are going to be using in a production system. Therefore, the exact procedure for testing your web service client belongs to you. It is beyond the scope of this document.

Exercise 9.6 - Ping MySQL with EGL Web Service 44