Sunday, June 21, 2015

Extract binary-content in OSB

Problem: 
From time-to-time, OSB will pass content via reference. For example the following.

<con:binary-content      ref="cid:-394e488:14e149a6684:-7f0d" xmlns:con="http://www.bea.com/wli/sb/context"/>

Resolution:
Use the java callout method org.apache.commons.codec.binary.StringUtils.newStringUsAscii() from commons-codec-1.7.jar to convert reference into string.

Got-cha:
Be sure to place the star in to fetch the byte[] content in $attachments/ctx:attachment/ctx:body/*

Enjoy.