ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » BLOB as Email Attachment

Post new topic  Reply to topic
 BLOB as Email Attachment « View previous topic :: View next topic » 
Author Message
m.schneider
PostPosted: Tue Aug 28, 2007 11:19 pm    Post subject: BLOB as Email Attachment Reply with quote

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));
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Aug 29, 2007 2:54 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Did you look at the javadoc for evaluateXPath? Is it capable of returning a byte[]?

Did you look at the samples in the section on using xPath in the info center?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
m.schneider
PostPosted: Wed Aug 29, 2007 4:08 am    Post subject: Reply with quote

Centurion

Joined: 10 Apr 2007
Posts: 132
Location: Germany

You're right it needs to be.


Stringdata = (String) message.evaluateXPath("string(//Data)");
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » BLOB as Email Attachment
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.