Using the Java Callout action to invoke Java code
In this recipe, we will show how we can use a Java Callout action to invoke Java code, which might already exist. This is an easy way to extend the standard functionality of the service bus.
We will use the Java Callout action to call a Java method which returns the Checksum of the message passed as the parameter. The functionality of calculating a checksum is not available as an XPath/XQuery function and adding it through a Java Callout action is of course much simpler and more efficient than using a real web service.
Getting ready
You can import the OSB project containing the base setup for this recipe into Eclipse OEPE from \chapter-9\getting-ready\using-java-callout-to-invoke-java
.
How to do it...
We will first create the Java project with the Java class holding the checksum calculation functionality. In Eclipse OEPE, perform the following steps:
Right-click on the Project Explorer and select New | Project.
Enter
java
into the Wizards field...