Sometimes in SOA Suite 11g you need to pass binary data to a web service reference. In SOA Suite 11g there is no standard XSLT or XPATH function which you can use. But in BEPL you can use embedded java, like Sudheer already blogged about. He used the com.collaxa.common.util.Base64Encoder class which does not exists in 11g so I will use the new oracle.soa.common.util.Base64Encoder class.
As input I will retrieve some xml from the inputVariable, get the xml as a string, encode this and set the value to a base64Binary variable.
Would a custom XPath function also be possible? In this case you can implement it at one place and use it everywhere !
ReplyDeleteHi,
ReplyDeleteThat should be possible only you need to find out what the input is like a string , xml or binary.
and need to deploy it on the soa server and to every developer pc. Sometimes this is too much
thanks
Thank you for this useful post. What other imports are required besides oracle.soa.common.util.Base64Encoder class. I get failure in compile execlets of bpel process.
ReplyDeleteHi,
ReplyDeleteI use the full path and don't use imports.
You can check my code for all the classes.
thanks
Right, it works now. Thank you for your suggestion.
ReplyDeleteHello Edwin,
ReplyDeletenice article which help me to decode base64 in Oracle BPEL. At the moment I have problem to access the right Part of Variable. It seems that the XPath is not relevant. I got no more information in Oracle Support Web, may be you have an idea:
getVariableData("inputVariable", "payload", "//ns1:document/ns1:Metadata");
System print output:
?
?
?
?
?
?
?
?
?
?
?
Thanks
Marcel
Hello Edwin,
ReplyDeleteit's me once again. I do some research and an output via convertDomNodeToString and the result shows that getVariableData works fine.
The problem is the getDocument function. It seems that this get the whole variable data. I hope to find a solution.
Thanks
Marcel
Hi,
ReplyDeleteCan you test getVariableData in bpel first, there must somewhere a mistake.
thanks
Hi Edwin,
ReplyDeletegetVariableData seems to work fine. I print out the data with convertDomNodeToString and it looks good. After "getDocument" the variable contains the whole variable data.
Regards
Marcel
String System_base64string = ((oracle.xml.parser.v2.XMLElement)getVariableData("InvokeSyncReadFile_SynchRead_OutputVariable","opaque","/ns3:opaqueElement")).getFirstChild().getNodeValue();
ReplyDeleteThis is returning XML document from First node. But my requirement is to extract the
XML document from second child element.
For Ex:
Then I need output from tag.
Please help me on this.