OSB Binary Data to text

3k views Asked by At

I am getting the below error after I used the below java callout fro transforming the binary data to text in OSB java callout.

public static String Decode(Object encodedDataRef) throws Exception 
{
    byte[] bytes = (byte[])encodedDataRef;
    String decodedData = new String(bytes);

    // System.out.println("DecodedData=" + decodedData);
    return decodedData;
}

Callout to java method public static java.lang.String com.lch.util.Utility.Decode(java.lang.Object) throws java.lang.Exception resulted in exception:

com.bea.wli.sb.context.impl.BinaryContentDocumentImpl cannot be cast to [B java.lang.ClassCastException: com.bea.wli.sb.context.impl.BinaryContentDocumentImpl cannot be cast to [B at com.lch.util.Utility.Decode(Utility.java:70)

I have assigned the binarycontent as $body/* or $body/ctx:binary-content to the variable myBinary and passed it as input parameter to the above java code. getting the above error.

Please advise what is wrong.

0

There are 0 answers