Skip to main content

skip to main content

developerWorks  >  Rational | Information Management  >

Create a J2C application for an Information Management System (IMS) phonebook transaction using IMS TM Resource Adapter

developerWorks
Go to the previous pagePage 4 of 8 Go to the next page

Document options
PDF format - Fits A4 and Letter

PDF - Fits A4 and Letter
2957 KB (46 pages)

Get Adobe® Reader®


My developerWorks needs you!

Connect to your technical community


Rate this tutorial

Help us improve this content


Task 3: Deploy and test your application

In this section, you will start the WebSphere Application Server, add your project to the application server runtime environment, and test your application using the simple JSP client that was created as part of the J2C Java Bean wizard.

Deploying your application

  1. Select the Servers view within the J2EE perspective.

  2. Using the Servers view, select the WebSphere Application Server v6.1 and click the green forward arrow icon to start the server, as shown in Figure 37. It will take a few moments for the application server to start:

Figure 37. Starting the WebSphere Application Server
Servers tab
  1. After the Console displays the "Server server1 open for e-business" message, click the Servers view and check the Status indicator.

  2. When the WebSphere Application Server is started, the Servers view will display Started in the Status field, and Synchronized in the State field, as shown in Figure 38:

Figure 38. Status and State of the WebSphere Application Server
server Status and State
  1. You now must add your project to the started application server. Using the Servers view, right-click WebSphere Application Server v6.1 and select Add and Remove Projects, as shown in Figure 39.

Figure 39. Adding your project to the started application server
menu command
  1. From the Add and Remove Projects page, select J2CPhoneBookEAR and click Add > to add your project to the Configured Projects, as shown in Figure 40.

Figure 40. Adding your project to configured projects
available and configured projects
  1. Click Finish to add your project to application server. The WebSphere Application Server will publish the application, as shown in Figure 41:

Figure 41. Publishing the application
State reads Publishing
  1. WebSphere Application Server then returns to a Synchronized state, as shown in Figure 42:

Figure 42. Returning to synchronized state after publishing the application
State reads Synchronized
  1. If not switched automatically, switch to the Console view and verify that the application has started successfully, as shown in Figure 43.

Figure 43. Console view
Application Started: J2CPhoneBookEAR


Back to top


Testing your application

In this section you will test the simple JSP client that was created as part of the J2C Java Bean wizard.

  1. Select the generated TestClient.JSP file that is located in the myJSPs folder. Recall that this is the folder you created to store the simple JSP test client. If the TestClient.JSP file is not visible, navigate to the J2CPhoneBook > WebContent > myJSPs folder in the Project Explorer.

  2. With the TestClient.jsp selected, Right-click and select Run As > Run On Server, as shown in Figure 44.

Figure 44. Running the TestClient.jsp
menu command
  1. Choose the started WebSphere Application Server v6.1 and click Finish to run the TestClient.jsp, as shown in Figure 45:

Figure 45. Choosing the server to run the JSP
choose existing or manually define new
  1. The Web Services Test Client will launch the TestClient.jsp. Notice that there are three separate panes (Java Methods, Input parameters, and Results) within the TestClient.jsp, as shown in Figure 46:

Figure 46. The Web Services Test Client view
Methods, Inputs, and Results on right
  1. Double-click the Web Services Test Client title to maximize the window within the workbench, and then click the runPhoneBook method to test.

  2. Enter the following values to test the J2C bean, as shown in Figure 47:
    1. in__ll: 59
    2. in__trcd: IVTNO
    3. in__zz: 0
    4. in__cmd: DISPLAY
    5. in__name1: LAST1


  3. Make sure not to enter any spaces before or after any of the input fields.

  4. Click Invoke to run the application.

Figure 47. Testing TestClient.jsp in the Web Services Test Client
specify input arguments
  1. Resize the result area to check your results, as shown in Figure 48:

Figure 48. Resizing the result area
Results

You should see something similar to the results shown in Figure 49.


Figure 49. Results from the testing
examine results
  1. Select Windows > Reset perspective and OK.

  2. Using the Servers perspective, click the red square icon to stop the WebSphere Application Server, as shown in Figure 50:

Figure 50. Stopping the WebSphere Application Server
red arrow points to red stop icon
  1. Close all open editor windows (pressing Ctrl+Shift+F4 should accomplish this).

You have completed the IMS J2C tutorial. If you have extra time, you can do a bit more. How about taking the generated J2C bean and wrapping that as a Web service? This feature extends the usage of your J2C bean past simple Web clients and offers the transaction as a Web service.



Back to top



Go to the previous pagePage 4 of 8 Go to the next page