converting base64Binary to PDF in BPEL 10.3.1
777966Jun 8 2010 — edited Feb 26 2020I receive a PDF as input to my BPEL process in base64Binary format. I have to convert it back to PDF and post it to a folder. I tried applying this code in 'Java Embedding' process, but is not working. Can you please take a look and suggest what am I doing wrong?
I am able to compile the code successfully but it gets stuck at java_embedding process during runtime.
Thank you.
Karan
<bpelx:exec import="java.util.*"/>
<bpelx:exec import="java.io.*"/>
<bpelx:exec import="java.lang.*"/>
<bpelx:exec import="java.math.*"/>
<bpelx:exec import="java.net.*"/>
<bpelx:exec import="com.collaxa.common.util.Base64Decoder"/>
<bpelx:exec import="com.collaxa.common.util.Base64Encoder"/>
String inputString =(String)getVariableData("input");
Base64Decoder Decoder = new Base64Decoder();
FileWriter outputStream = null;
try {
String decoded = Base64Decoder.decode(inputString);
//setVariableData("outputString",decoded);
outputStream = new FileWriter("E:\\output\\outputFile.pdf");
outputStream.write(decoded);
if (outputStream != null) {
outputStream.close();
}
}
catch(UnsupportedEncodingException uee) {
uee.printStackTrace();
}
catch (IOException e) {
System.err.println("Caught IOException: " + io.getMessage());
}