aspose file tools*
The moose likes Web Services and the fly likes soap mulitple image attachements. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "soap mulitple image attachements." Watch "soap mulitple image attachements." New topic
Author

soap mulitple image attachements.

peter cooke
Ranch Hand

Joined: Mar 16, 2004
Posts: 317
I am trying to attach several images to a soap message.
I can get one image to attach but additonal attachements will not work. What am I doing wrong.

String imageFile1String = fileName1.getText();
System.out.println("fileName1 = " + imageFile1String);
URL imageFile1URL = null;
try {
imageFile1URL = new URL(imageFile1String);
} catch (MalformedURLException e2) {
e2.printStackTrace();
}
DataHandler handler1 = new DataHandler(imageFile1URL);
AttachmentPart attachPart1 = message.createAttachmentPart(handler1);
message.addAttachmentPart(attachPart1);
handler1=null;
imageFile1String=null;
imageFile1URL=null;








String imageFile2String = fileName2.getText();
System.out.println("fileName2 = " + imageFile2String);
URL imageFile2URL = null;
try {
imageFile2URL = new URL(imageFile2String);
} catch (MalformedURLException e2) {
e2.printStackTrace();
}
DataHandler handler2 = new DataHandler(imageFile2URL);
AttachmentPart attachPart2 = message.createAttachmentPart(handler2);
message.addAttachmentPart(attachPart2);
handler2=null;
imageFile2String=null;
imageFile2URL=null;


CIAO Peter M. Cooke
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by peter cooke:
I am trying to attach several images to a soap message.
I can get one image to attach but additonal attachements will not work.


what is the error message you are getting ? BTW Is your method is configured to attach more than one image ?


Spritle Software Blogs
peter cooke
Ranch Hand

Joined: Mar 16, 2004
Posts: 317
Yesterday the application:
when there was one image attachment it wrote the image binary.
when there was more than 1 image attachment, the process wrote one image, then hung in createAttachment()

Today:Grumble (have to give the procedure) it is hanging in another location. for some reason now it hangs when I write the soap message to the file system)

peter cooke
Ranch Hand

Joined: Mar 16, 2004
Posts: 317
I was able to work through things.... learned my problem was my understanding of api.

Thanks
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Thanks for update. :roll:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: soap mulitple image attachements.