Test the Web service interactively
First, make sure that the server is running.
Click the Servers tab to select it.
Right click WebSphere Application Server v6.1
Click Start, as shown in Figure 21.
Figure 21. Ensure that the server is running
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:
Right-click WebSphere Application Server v6.1
Click Add and Remove Projects, as shown in Figure 22.
Figure 22. Add the project to the server
The Add and Remove Projects dialog appears.
In the Available Projects list:
The project moves to the right side of the window, under Configured Projects.
Click Finish, as shown in Figure 23.
Figure 23. Modify the projects that are configured on the server
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.
To start the Web Services Explorer, do the following in the Project Explorer (as shown in Figure 24):
Expand the Lab71Service project
Expand the WebContent directory
Expand the WEB-INF directory
Expand the wsdl directory
Select WebServices > Test with Web services Explorer
Figure 24. Start the Web Services Explorer
The Web services Explorer will appear in the browser in the Content Area.
Click the caTestbk method which is the service you are going to test.
In the Actions dialog.
Enter a valid California ZIP code 93000, as shown in Figure 25.
Figure 25. Invoke a WSDL Operation
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
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.