So the easiest way to remedy this problem is to create a embedded java in your BPEL to convert your variable to a string. This post is designed to walk you through that.
First we need to import the Binary encoder so right before all of the partnerlinks in our BPEL document we will want to add this import (This is for Oracle BPEL and the class maybe different for other flavors)
Depending on the direction you want to go.
Ok now we have our import now we need to create a variable to house our encoded string, I used...
Finally we will create our embedded Java, here is what mine looks like I encoded my string decoding would be similar.
String input = (String)getVariableData(
Base64Encoder Encoder = new Base64Encoder();
String encoded = Base64Encoder.encode(input);
Then I use an assign to assign the variable to the native payload.