OSB - Using Java Callout in OSB
OSB - Using Java Callout in OSB
See complete article here - http://oraclefusion1011.blogspot.com/2011/04/1.html. It is reproduced here for easy reference only. 1. Create a Java class that will have the Util methods , The method should be static public class MyOSBUtils { public static String getID(String ssn) { return "Id : "+getid_from_ssn(); } } 2.Create a JAR profile and deploy the project to JAR 3.Create a JAR resource in OSB inside project Explorer -> project -> Create Resource: -> JAR Give the JAR source File. 4. use Case - Bpel WS , returns Name based on ID - OSB consumer dont have ID and can pass ssn - Java callout based on ssn returns ID 5. - Create Bpel WS that returns Name based on ID - Create Direct Binding in Bpel , so OSB can call it 6. Create BS in OSB based on Direct Binding WSDL 7. Create proxy based on BS 8. Edit route: Request Actions: Java Callout to getID(Java class , select jar , then class and method) Parameters : xs:string($body/ret:process/ret:input) [need to type cast] Result : new_name [save in new parameter] 9. Add replace in Request Actions
replace - ./ret:process/ret:input - in variable body - with $new_name Flow : proxy(Input ssn)-> java callout (returns ID for SSN) -> Replace the input with ID -> Call bpel -> respond with Name