Testing the proxy service through the OSB console
With the OSB configuration deployed successfully to our OSB server, it's time to test it. This recipe will show the most basic way to test, using the OSB console. This is good enough for some initial test but in the long term something more repeatable is necessary. One alternative option is using soapUI, which will be covered in the next recipe.
Getting ready
Navigate to the OSB console and login as the Administrator (that is, weblogic).
How to do it...
In the OSB console, perform the following steps:
Click on the menu item Project Explorer on the left-hand side of the OSB console.
In the project tree, click on basic-osb-service and in the details section on the right, the project folder tree will be shown.
Click on the proxy link.
The proxy service Customer Service should be displayed in the details section (might have to scroll down to see it):
Click on the bug symbol in the Actions section (highlighted in red in the preceding screenshot) to open the test window for the Customer Service proxy service.
In the Proxy Service Testing window, make sure you select the right operation in the Available Operations drop-down list. We want to test the RetrieveCustomerByCriteria operation.
Change the Payload field as shown in the following screenshot:
Click on the Execute button to run the test. The test results are returned after a while in the same window:
Check that the right customer (with
ID = 1
) information is being returned by the OSB service.Scroll down in the window to see the Invocation Trace section. This will show steps that the OSB proxy service has executed and values of the variables during execution:
How it works...
Due to the fact that the interface of the proxy service is clearly defined through the WSDL, the OSB console is capable of showing us a sample test message in the Payload field. If we have a proxy service without a WSDL, then testing that service will still be possible through that window, but there will no longer be a sample message shown, as the OSB console does not know about the structure.
The testing capabilities offered by the OSB console are good for some initial tests or if the execution trace is of value, possibly for debugging if using the graphical debugger is not an option. The limitation of the OSB console for testing is clearly that there is no way to persist a test case to be able to run it again later. By that it's also not possible to automate and repeat testing, for example, to start tests inside a nightly build. For that, soapUI, which will be shown in the next recipe, is much better suited.
See also
An alternative way for testing proxy services can be found in the next recipe Testing the proxy service through soapUI.