This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Web Services and the fly likes How to include file name for attachment? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to include file name for attachment?" Watch "How to include file name for attachment?" New topic
Author

How to include file name for attachment?

Bernhard Pauler
Greenhorn

Joined: Jun 04, 2005
Posts: 16
Hi!

I have a question regarding web services with attachments:

How can I assure that the name of the file I'm sending as an attachment is included in the transmission and can be read afterwards?

Is this possible with the DataHandler class?

Thanks for your answers,

Bernhard
Bernhard Pauler
Greenhorn

Joined: Jun 04, 2005
Posts: 16
I have found some info...

According to the article "Fear of Attachments" by Steve Loughran (damn good title ) it is possible to send the filename with MIME inside a header, but not so with DIME. The code sample in the article passes the filenames as a separate parameter.

I'm not sure but it seems that .NET only supports DIME out of the box. I don't want to lock out .NET users. There are third party libraries though.

Bernhard
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Apparently they are supposed to meet in the middle with MTOM
Web Services, Opaque Data, and the Attachments Problem

JAX-WS 2.0 MTOM and swaRef
MTOM in JAXWS RI 2.0 Final
Handling Binary Data with Axis2 (MTOM/SwA)

However there is the real possibility the each platform will serialize identical attachments in different ways
MTOM between Java and .NET - theoretically the other side should be able to handle it ... theoretically.
Bernhard Pauler
Greenhorn

Joined: Jun 04, 2005
Posts: 16
Thanks for your hint to MTOM. Will need some time to go through the provided links. Is it an adopted technique? Any hands-on experience?

Bernhard
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to include file name for attachment?