Friday, January 28, 2011

Java Client to Query ESB in Oracle SOA 10.1.3.x Suite

All that can be viewed on the ESB console can be accessed through the ESB client API as well. Infact, that is what works at the backend when the browser displays pages.

The jar needed in the classpath of  our java client (that will query the ESB) is the oraesb.jar available in /integration/esb/lib folder

To begin with, a wrote an ESBHandler class and added a method that connects up with the ESB using the oracle.tip.esb.client.ConsoleClient interface as below -








Now, all you have to do is invoke the perform method on the above client instance and provide the action you want to execute as the first param and a relevant/blank HashMap (acting as request parameters) as the second param. Like in my sample code below, I have queried the ESB to get the deployed DVM maps.You can likewise execute all the commands present in the package oracle.tip.esb.configuration.servlet.command as per my understanding :)

The above yields as output -

DVMs -->
 <getAllDVMs>
  <dvm name="SampleDVM1">
       <description>DVM description</description>
    </dvm>
 </getAllDVMs>

Monday, January 10, 2011

Java Client to Query BPEL processes in Oracle SOA 10.1.3.x Suite

Already existing console views for BPEL and ESB is good but there might be situations where you need to create your own customized console view based on business/functional requirements or you might need to generate a report on deployed services etc for customer. In such scenarios this blog might come in handy because it talks about java code to access BPEL processes deployed on Oracle 10g server. There is a separate blog post that talks about accessing ESB services.
 
1. The jars that need to be placed in the build path are as below -
  • orabpel.jar - bpel/lib
  • orabpel-common.jar - bpel/lib
  • oc4j-internal.jar - home/lib
  • optic.jar -opmn/lib

 2. To connect to the BPEL server the code is as below since we use rmi connection -

 where securityCredentials is the password for the 10g server.

3. Now connect to the server and fetch all the domains available in there....
















4. Now using the API from orabpel.jar, query the domain for processes and corresponding properties.

 
 5. A typical output of the entire code called from a Java client is shown below. Use similar code from your web project to create a totally different console view etc