- The Benefits of Inter-Portlet Communication
- The WebSphere Property Broker
- Creating a Service Provider
- Testing the Service Provider
- Creating a List Portlet
- Creating a Detail Portlet
- Configuring the WebSphere Property Broker
- Alternative Communication Methods
- When to Use Inter-Portlet Communication
- Important Points
Testing the Service Provider
Because you enabled test support for your service, WPF automatically generates test pages for your service provider, which you can disable from the Testing Support section of the Service Definition builder call. This enables you to test the service provider directly from the IDE. To test the service, run the loansService model from the WPF Designer by clicking the icon on the toolbar. This runs the currently active model (for instance, loansService) with the last run configuration you used. If you have not set up a run configuration before, you are prompted to do so—create a new configuration under the WebSphere Portlet Factory Model category. If you want more information on setting up a run configuration, see the "Testing the Application" section in Chapter 1.
After you run loansService, you should see the index test page in your default Web browser, as shown in Figure 7.1. This screen lists all the operations available on the loansService service.
Figure 7.1 Index test page from the loansService model.
To test the getLoansList operation, click the getLoansList link. You should see a list of loans, as shown in Figure 7.2. If not, check that you don't have any errors showing in the Problems view in the IDE and that you have completed all the steps in the previous section correctly. Press Back to return to the index page.
Figure 7.2 Testing the getLoansList operation.
To test the getLoanDetail operation, click the getLoanDetail link. The screen that follows asks you to enter in an ID of a loan you would like to retrieve details for. Enter in 00001 as the ID and press the Submit Query button. You should see some details for the loan that has an ID of 00001 (that is, The Gullible Traveler), as shown in Figure 7.3. Press Back when you are finished.
Figure 7.3 Testing the getLoanDetail operation.
Close the loansService model when you've finished testing it.
You now have a service provider called loansService, which provides a list of loans and details on individual loans. The next few sections walk through the process of creating consumers for the loansService service in the form of a list portlet and detail portlet.