I have a singleton java class which runs whenever the weblogic server gets started and store the output in its object. I need to access this java object from a proxy service in osb.
We tried using java call out and retrieved that object but we couldn't know how to parse that object into XML.
We are not sure of using the java call out in osb to solve this purpose because whenever we use a java callout, that particular java code will run which is not the case of singleton class.
So kindly help us how to retrieve the java object which holds the output without running the java code every time because its already run and holding the output in its object.
here the doc http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1106656
but I guess you are already at the stage of getting a POJO in a first Java Callout and passing the POJO to a second Java Callout, which should then return it to OSB as a XMLObject.
My recommendation is to write a Java function which returns a XMLObject and uses a XMLCursor to populate it with the values of the POJO.
An XMLObject returned to the OSB is automatically transformed in a "XML" variable (which in reality is represented as a XMLObject in the Pipeline context)
Here some code sample:
I used a java call out and got the output in the format.
"<con:java-content ref="jcid:7604bc31:12f9af31afb:-7f81" xmlns:con="http://www.bea.com/wli/sb/context"/>"
Can u help me in how to retrieve the details from this POJO. Sorry am not clear with the points specified in the documents.
this is exactly what I was trying to convey you, Prabhu: to extract the data from you Java POJO and use those data in OSB your only chance is to convert - in your Java callout - the POJO into a XMLObject. For that purpose I have passed you the link to some sample code using XMLObject and XMLCursor.
An alternative way is that in your Java Callout you manually build a String containing valid XML, and use a XMLFactory to transform it into a XMLObject
this is the API you can use: