Hi Gurus
We have a field defined as type base64binary - to which we need to cast an attachment as an XOP: Include MTOM attachment - how can I achieve this in the below UDF.
As we are able to get the attachment created - however, it needs to be cast as XOP Include as seen below.
The field name is FileAttachmentHandler
<ns0:FileAttachmentHandler>
<xop:Include href="cid:0aa38897-1525-44bc-93d8-05789234@example.jaxws.sun.com" xmlns:xop="http://www.w3.org/2004/08/xop/include"/>
</ns0:FileAttachmentHandler>
Is it possible to cast it to this field in the below UDF by modifying or is it something which can be achieved by XSLT or some other way ?!
Your help is greatly appreciated!!
Thank you,
Ritu
Below UDF which I got from earlier forums posting - helps to create attachment successfully:
GlobalContainer globalContainer = container.getGlobalContainer();
String decodedContent="";
byte[] decodedValue = DatatypeConverter.parseBase64Binary(var1);
decodedContent=new String(decodedValue);
byte[] convertedInput = decodedContent.getBytes();
OutputAttachments outputAttachments = globalContainer.getOutputAttachments();
Attachment outputAttachment;
String contentType= "application/octet-stream";
outputAttachment = outputAttachments.create("Myfile.pdf", contentType, convertedInput);
outputAttachments.setAttachment(outputAttachment);
return "";