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>

No comments:

Post a Comment