Skip to content

Instantly share code, notes, and snippets.

@biemond
Created September 27, 2011 21:59
Show Gist options
  • Save biemond/1246375 to your computer and use it in GitHub Desktop.
Save biemond/1246375 to your computer and use it in GitHub Desktop.
oracle bpel java embedded code
<variables>
<variable name="inputVariable"
messageType="client:XSLTTransformatieProcessRequestMessage"/>
<variable name="bestand"
type="xsd:base64Binary"/>
</variables>
<bpelx:exec name="intermediairproductToBase64"
version="1.5"
language="java">
<![CDATA[
oracle.xml.parser.v2.XMLElement input = (oracle.xml.parser.v2.XMLElement)
getVariableData("inputVariable",
"payload",
"/ns4:productBericht/ns4:intermediairProduct");
oracle.xml.parser.v2.XMLDocument xmlDoc = input.getDocument();
java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
try {
xmlDoc.print(baos );
java.lang.String xml_result = baos.toString();
oracle.soa.common.util.Base64Encoder encoder = new oracle.soa.common.util.Base64Encoder();
java.lang.String encoded = null;
encoded = encoder.encode(xml_result);
setVariableData("bestand",encoded);
baos.close();
} catch (java.io.IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}]]>
</bpelx:exec>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment