aspose file tools*
The moose likes Web Services and the fly likes Attachments with Axis Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Attachments with Axis" Watch "Attachments with Axis" New topic
Author

Attachments with Axis

Dan Miller
Greenhorn

Joined: Nov 19, 2008
Posts: 3
Hello,

I'm somewhat of a Web Services newbie. I am trying to modify an existing web service that FTPs a CSV file from a legacy system, reads through it, and writes some XML out to the web service. It is pretty top-down in that (for the most part) it reads a line of CSV, writes out a chunk of XML, rinse, repeat.

We are using Apache Axis 1.4 and what appears to happen is that Axis / Apache builds the whole String in memory before writing out the response.

Because the files we are sending are quite large, we occasionally run out of memory while processing them. As part of the rewrite of the service, I'm being asked to rewrite the service so that it takes up less memory.

In doing a bit of reading around I have come across the concept that for large files, the best practice is to use SAAJ / attachments.

I was wondering if anyone had any pointers to some good introductory lessons on that? I've read

http://java.sun.com/webservices/docs/2.0/tutorial/doc/

but most of the examples I see there have explicit SoapMessage and AttachmentPart objects in the code - all the code I am trying to re-use has all of that abstracted by Axis.

Thanks for reading and feel free to ask clarifying questions. I'll be the first to admit I only have a rudimentary grasp of this.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
Dan,

An identical question and a similar one in this forum.

Regards,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Dan Miller
Greenhorn

Joined: Nov 19, 2008
Posts: 3
Dan,

Thanks for taking the time to reply.

Now, I may be misreading the links that you sent (such are the downsides of not totally understanding the basic framework), but both of those links seem to talk about how to READ attachments when consuming a web service.

I am trying to PROVIDE attachments as part of the service.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Attachments with Axis
 
Similar Threads
New To Web Services
Files to create a Java web services by hand
jwsdp 1.6 jws tutorial
Web Services - beginner
Calling a ColdFusion Web Service method