axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Axis User <axisu...@gmail.com>
Subject Re: reading large attachments
Date Mon, 01 Aug 2005 16:14:26 GMT
Hi Tom,
Thanks for your reply. Further to my last mail I should say that
sending large attachments sequentially works fine. The problem for me
arises when I have multiple clients sending in parallel (i.e.
concurrent invocation of the service method) - sometimes
getAttachmentCount() returns 0 other times it works fine (with your
code fragment it becomes a NoSuchElement exception thrown
occasionally)

Have you encountered or tested this situation before?

Does anyone know if Axis supports writing multiple attachments at the same time?

Thanks,
Michael

On 8/1/05, Tom Ziemer <t.ziemer@dkfz-heidelberg.de> wrote:
> 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