Introduction:
Java Callout activity is used to call custom java methods from proxy services in OSB.For this it is needed to create a POJO (Plain Old Java Object) class and create different methods.
The java methods which you want to call from proxy services must be static.
Following data types are supported as method parameters:
- String
- Primitive types, and their corresponding class types
- BigDecimal
- BigInteger
- XmlObject
- Single array type of above data types
- javax.activation.DataSource
Following return types are supported from a java method:
- String
- Primitive types, and their corresponding class types
- XmlObject
Note: void is not supported as a return type.
How to use Java Callout in OSB:
Follow the below steps to use a Java Callout in proxy services in OSB:
[Note: The steps shown below are performed in Eclipse IDE]
Step-1: Create a POJO class and a method as shown below :
Step-2: Create a jar file to use the above method.
Step-3: Create a new OSB project and create a new proxy service.
Copy the jar file (created in Step-2) in your OSB project. Go to the
proxy service and drag the Java Callout action. Click on the browse
button, select the jar file and select the getWelcomeName Method.
Step-4: Enter the parameter value as "Guest" and define a result variable
Step-5: Use a log activity to print the result
Step-6: Test the proxy service
Response of the proxy service:
Comments
Post a Comment