This sample shows how a service can be created that wraps existing code. The Audit Service is a sample service that records the arrival of messages at the service by echoing messages on arrival.
This sample is not the recommended way to use a file for auditing messages in a Progress Sonic ESB environment. Rather, it is an example of how to:
Take an existing class (in this case,
Wrap it as a Sonic ESB service (in this case, the
Use it in the context of Sonic ESB messages and ESB processes.
The following files are used for this sample:
||Source for the example java class|
||Source for this XQService|
||Definition file for this service type|
||Service configuration properties file to customize the Sonic Workbench GUI for this service type.|
Do not edit the service configuration properties file directly. It is modified by the Java service type editor .
To run the AuditService sample:
Start Sonic Workbench (see Starting Sonic Workbench ).
If you have not already done so, import the Sonic ESB samples (see Importing Sonic Workbench sample projects).
Select the following file in the Navigator in the Sonic Design perspective:
Right-click and select . The file opens in the
Java service type editor
Follow the directions in the editor to upload the
Sample.AuditServiceType.esbstyp file to the domain. The dev_ESBTest
container is also restarted.
Click the drop-down list on the toolbar of the Java service type editor to view the scenarios:
Select the Message Test 1 scenario and click Run to run that scenario. (If the button is not enabled, click in the editor page.)
Observe the output in the Output view.
Go to the Containers view. Right-click on the dev_ESBTest container and select.
Observe the audit messages in the container log.
Then repeat these steps to run the other two scenarios.