Thanks for both of the replies that has helped me out a lot.

Brando, one final question if you don't mind? Currently I am using the rpc 
message handler for my exposed method and I will only ever be serving files, 
not accepting them for upload by the client. Is the ADBMessageReceiverInOut 
better suited to attachments that the rpc message handler?

Thanks again,

Paul
From: brando.argue...@gdc4s.com [mailto:brando.argue...@gdc4s.com]
Sent: 04 December 2012 16:32
To: java-user@axis.apache.org
Subject: RE: Attachments Service

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(soTimeout);

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

********************************************************************************************************************

********************************************************************************************************************

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

********************************************************************************************************************

Reply via email to