Posted: Tue Aug 28, 2007 11:19 pm Post subject: BLOB as Email Attachment
Centurion
Joined: 10 Apr 2007 Posts: 132 Location: Germany
Hi,
I'm trying to send a BLOB as an email attachment.
First I send a XML-structure with a BLOB to my JCN with the mail code.
...
Set OutputRoot.XML.Message.Data = CAST(ASBITSTREAM(InputBody) AS CHAR CCSID InputRoot.MQMD.CodedCharSetId);
...
Then I try to cast it to a Java byte, but I get a java class cast exception, ...
byte[] data = (byte[]) message.evaluateXPath("string(//Data)");
Can anyone help?
And how can I attach the data? Is this code right?
// attach the file to the message
ByteArrayDataSource ds = new ByteArrayDataSource(data, "application/x-any");
mbp2.setDataHandler(new DataHandler(ds));
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum