Tuesday, November 29, 2011

Common JAVA framework to invoke the Oracle SOA Suite Composite services

Common JAVA framework to invoke the Oracle SOA Suite Composite services:

There are different approaches to invoke the SOA Composites through java like DirectConnection, ADFBinding etc. But in both the approaches we have to add the additional configurations in the Composite.xml file.
Instead of using this approach, we can use the Apache Axis framework to invoke all the composites as a webservice.
We have implemented a Service Invocation Framework to invoke the composites through JAVA.
We have to set the endpoint and the operation name correspondingly to invoke the service.
I thought of sharing the framework as this may help somebody looking for same kind of framework.
Sample Client to Invoke the service(download the framework attached):
String endpoint="http://soahost:soaport/soa-infra/services/default/HelloWorld/helloworld_client_ep";

String xmlInput="<ns1:process xmlns:ns1=\"http://xmlns.oracle.com/EAIRules/HelloWorld/HelloWorld\">\n" +
" <ns1:input>Albin Issac</ns1:input>\n" +
" </ns1:process>";

InputObject inputParamObj = new InputObject();
System.out.println("End pint URL " +endpoint );
inputParamObj.setSServiceEndPoint(endpoint);
inputParamObj.setSOprName("sayHello");
inputParamObj.setInputPayload(xmlInput);
// Getting service invoker class to invoke service.
ServiceInvoker serviceInvoker =ServiceInvoker.getInstance();
try {
serviceInvoker.invokeService(inputParamObj, null);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("Process Successfully Invoked!<br>");

DOWNLOAD WebServiceInvocationFramework.zip


1 comment:

  1. Hi ,
    Thanks for sharing . Could you please paste the jars that you used?

    ReplyDelete