Paul,
Yes, it is that simple. .what I did... serviceObject.setDataHandler(new DataHandler(new FileDataSource(file))); Two issues I had were: 1. When uploading / downloading large files (45 Megs + ) the client was timing out. The workaround was to increase the client timeout. this.stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(soTi meout); 2. MTOM is not supported by JIBX, the binding framework I was using, so for the methods doing upload/download I defaulted to ADB. Also, in services.xml I added ... <service name="Your service"> <parameter name="enableMTOM">true</parameter> <operation name="The download/upload method"> <messageReceiver class="xxx.xxx.xx.theADBMessageReceiverInOut"/> </operation> Regards. brando From: Ockleford Paul (NHS CONNECTING FOR HEALTH) [mailto:paul.ocklef...@nhs.net] Sent: Tuesday, December 04, 2012 11:09 AM To: java-user@axis.apache.org Subject: Attachments Service Hi, I am currently investigating the best way to write a web service using axis 2 that returns a csv file. I found an example online that I managed to get working, although it's very simplistic. I have copied the method I expose below as I would like to know if this is a suitable approach to sending attachments, it seems far too simple and I wonder if there are any implications that I don't know about to doing it this way: public DataHandler getFile(String fileName) { FileDataSource dataSource = new FileDataSource(fileName); DataHandler fileDataHandler = new DataHandler(dataSource); return fileDataHandler; } If anybody can help me out I would appreciate it. Thanks, Paul ************************************************************************ ******************************************** This message may contain confidential information. If you are not the intended recipient please inform the sender that you have received the message in error before deleting it. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Thank you for your co-operation. NHSmail is the secure email and directory service available for all NHS staff in England and Scotland NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and GSi recipients NHSmail provides an email address for your career in the NHS and can be accessed anywhere ************************************************************************ ********************************************