You define a Function (right click, new child -> procedure -> udf) on your view model, then in its properties you need to define the class-name, method name etc from your java class. Note that the function parameters need to match your java method. Then use that function in your web service transformation as any other function.
@Ramesh - Thank you for the tip on the creating the UDF Procedure. Didn't have a clue how to build that.
@Barry - thank you for posting the example