Skip to main content

skip to main content

developerWorks  >  Rational | SOA and Web services  >

Creating and Consuming Web Services Using IBM Rational Business Developer (EGL)

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

Document options
PDF format - Fits A4 and Letter

PDF - Fits A4 and Letter
3428 KB (9 pages)

Get Adobe® Reader®


My developerWorks needs you!

Connect to your technical community


Rate this tutorial

Help us improve this content


Test the Web service interactively

First, make sure that the server is running.

  1. Click the Servers tab to select it.
  2. Right click WebSphere Application Server v6.1
  3. Click Start, as shown in Figure 21.

Figure 21. Ensure that the server is running
menu command

Once the server has started (this may take several minutes), the console will show Server server1 open for e-business, and the Servers tab will reflect started under the Status column.

Next, add the project to the server:

  1. Right-click WebSphere Application Server v6.1
  2. Click Add and Remove Projects, as shown in Figure 22.

Figure 22. Add the project to the server
menu command

The Add and Remove Projects dialog appears.

In the Available Projects list:

  1. Select LAB71_Web_ServiceEAR.
  2. Click Add.

The project moves to the right side of the window, under Configured Projects.

  1. Click Finish, as shown in Figure 23.

Figure 23. Modify the projects that are configured on the server
available projects on left, configured on right

Be patient while the Server reconfigures, as it may take some time. After it has finished (the console stops scrolling), you will be ready to test your service.

Rational Developer for System i SOA offers a useful interactive Web services test facility called the Web services Explorer. You can use this tool to test your Web service functionality effectively, before embedding calls to it from your service client.

  1. To start the Web Services Explorer, do the following in the Project Explorer (as shown in Figure 24):
    1. Expand the Lab71Service project
    2. Expand the WebContent directory
    3. Expand the WEB-INF directory
    4. Expand the wsdl directory
    5. Right-click zipService.wsdl
    6. Select WebServices > Test with Web services Explorer

Figure 24. Start the Web Services Explorer
menu command

The Web services Explorer will appear in the browser in the Content Area.

  1. Expand zipServiceBinding.
  2. Click the caTestbk method which is the service you are going to test.
  3. In the Actions dialog.
  4. Enter a valid California ZIP code 93000, as shown in Figure 25.
  5. Click Go.

Figure 25. Invoke a WSDL Operation
Navigator on left, Actions on right

On the bottom Status dialog, you will see the result from the Web service.

You will get a return value of 0, as shown in Figure 26.


Figure 26. Result of operation
variable return(int) with value of 0

Try the same with an input value of 99999 and the return value will be -1. These results are expected, because this is how you coded the service.

What you have done so far

You have now created a Web service and tested it using the Web Services Explorer.

You can now install the EAR file on your production server, and change the WSDL file to reflect the new location of the service and give the WDSL file to potential user of the service. This will allow these folks to create applications easily that use this service.

The next section shows you how to take a WSDL file and create an EGL application that uses the service described in the WSDL.



Back to top



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