This post will explain how to decode the Base64Encoder content in a BPEL process.
Define Two variables of type sting in the BPEL process(TempVar, decodedString).
1. TempVar to copy the encoded data to that variable.
In the assing activity copy the Base64Decoder content to this TempVar variable.
In my case TempVar = ora:readFile($WriteDir)
2.decodedString to consume the final decoded content from java embeded activty.
Take a Java embedded activty and copy the below content to the java embedded acitivity. to get decoded content.
addAuditTrailEntry("decoding started");
String encodedString = (String)getVariableData("TempVar");
Base64Decoder Decoder = new Base64Decoder();
addAuditTrailEntry("encoded String = "+encodedString);
try
{
String decoded = Base64Decoder.decode(encodedString);
addAuditTrailEntry("decoded string = "+decoded);
setVariableData("decodedString",decoded);
}
catch(Exception e)
{
addAuditTrailEntry("Exception: "+e.getMessage());
}
Finally you can get the decoded content from the decodedString variable in you BPEL process.
Define Two variables of type sting in the BPEL process(TempVar, decodedString).
1. TempVar to copy the encoded data to that variable.
In the assing activity copy the Base64Decoder content to this TempVar variable.
In my case TempVar = ora:readFile($WriteDir)
2.decodedString to consume the final decoded content from java embeded activty.
Take a Java embedded activty and copy the below content to the java embedded acitivity. to get decoded content.
addAuditTrailEntry("decoding started");
String encodedString = (String)getVariableData("TempVar");
Base64Decoder Decoder = new Base64Decoder();
addAuditTrailEntry("encoded String = "+encodedString);
try
{
String decoded = Base64Decoder.decode(encodedString);
addAuditTrailEntry("decoded string = "+decoded);
setVariableData("decodedString",decoded);
}
catch(Exception e)
{
addAuditTrailEntry("Exception: "+e.getMessage());
}
Finally you can get the decoded content from the decodedString variable in you BPEL process.
No comments:
Post a Comment