axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Ziemer <t.zie...@dkfz-heidelberg.de>
Subject Re: reading large attachments
Date Mon, 01 Aug 2005 15:14:15 GMT
Hi,

try this:

	DataHandler dh = null;
         Message m = context.getCurrentMessage();
         logger.info("[client]: Found attachments: "+m.countAttachments());
         Iterator it = m.getAttachments();
         while(it.hasNext())
         {
             AttachmentPart ap = (AttachmentPart)it.next();
             dh = ap.getDataHandler();
	    ...
         }

I am using Axis 1.3 (CVS) and can send (Server->Client) large files (up 
to 1.2GB) without a problem.

Hope this helps,
Regards,
Tom


Axis User wrote:
> Hi,
> First some info...
>  
> Platform: Axis 1.2.1, Java 1.5.0_04-b05, Linux 2.6.11.4-20a-default
> 
> Aim: to send a zip file attached to a SOAP message and save it to a
> directory. Zip files will on average be around 50Mb.
> 
> Code:
> //On the client side I add attachments as below:
> 
> DataHandler handler = new DataHandler(new FileDataSource(file));
> stub.addAttachment(handler);
> 
> //server side retrieval
> MessageContext msgContext = MessageContext.getCurrentContext();
> Message requestMessage = msgContext.getRequestMessage();
> int numAttachments = requestMessage.getAttachmentsImpl().getAttachmentCount();
> 
> Problem:
> The problem seems to be to me that my service method is being invoked
> before the entire attachment has been transferred hence numAttachments
> == 0 even though the client always sends an attachment. Is there a way
> to determine that the entire message has been received before querying
> the number of attachments? In this case the attachments are ~45mb
> 
> Thanks,
> Mike

Mime
View raw message