By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,454 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Add a attachment with a jpeg file to a soap messages

P: n/a
Hi everybody!!
First of all, sorry about my english. I promise to improve it. I have
a big problem when I try to add an attachment which contains a image
in it. I have to solve it as soon as possible so i would really
appreciate any help.
The mistake thrown is the following:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME
type image/gif at javax.activation.ObjectDataContentHandler.writeTo(
at javax.activation.DataHandler.writeTo(DataHandler.j ava:305)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyP
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyP
at javax.mail.internet.MimeMultipart.writeTo(MimeMult
at com.sun.xml.messaging.saaj.soap.MessageImpl.saveCh anges(
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConn
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConn ection$ :151)
at Method)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConn
Feb 20, 2004 12:43:54 PM com.sun.xml.messaging.saaj.soap.MessageImpl
SEVERE: SAAJ0540: Error during saving a multipart message
com.sun.xml.messaging.saaj.SOAPExceptionImpl: Error during saving a
multipart message
The code is this:
************************************************** *********************************************

File fd = new File("/home/tibco/products/adapters/development/esther/mm7inbound/scripts/1.gif");
FileInputStream miFicheroSt = new FileInputStream(fd);
int numb = miFicheroSt.available();
byte[] imagen = new byte[numb];
for (int i= 0; i<numb;i++)
AttachmentPart ap = message.createAttachmentPart();
//DataHandler pdfDH = new DataHandler(miFicheroSt ,"text/plain");
ap.setContent(new ByteArrayInputStream(imagen) ,"image/gif");

Thanks in advance.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply

P: 1
Hi Antonio.

I too am having the same problem. Could you please let me know if you have any solution for the soap atachment.
please email me at

I really appreciate your help if you can send me the solution.

Nov 8 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.