You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "leple.franck@tiscali.fr" <le...@tiscali.fr> on 2004/11/10 12:59:22 UTC

Attachment file locked

   Hello,

I have created some Web Services with attachments. 
For do that, I have followed the thread "zip files as attachments" (see "http://marc.theaimsgroup.com/?l=axis-user&m=107780801011044&w=2"). Thanks people it was very helpful ;-). 

I have just one problem with my Web Services. On my server side, the zip file passed by attachment is locked by Axis and I can't delete it. I have looked at the thread "ttachment and closed stream question" (see "http://marc.theaimsgroup.com/?l=axis-user&m=109598153701095&w=2") but the solution is useful for the client side only.

I tested it with AXIS 1.1 and AXIS 1.2RC1. I write the following code on my server :

org.apache.axis.MessageContext msgContext = org.apache.axis.MessageContext.getCurrentContext();
org.apache.axis.Message msg = msgContext.getResponseMessage();
(...)
msg.getAttachmentsImpl().setSendType(org.apache.axis.attachments.Attachments.SEND_TYPE_DIME);
ByteArrayDataSource bads = new ByteArrayDataSource(new File(zipFile), "application/x-zip-compressed");
DataHandler dh = new DataHandler(bads);
org.apache.axis.attachments.AttachmentPart replyPart = new org.apache.axis.attachments.AttachmentPart(dh);
msg.addAttachmentPart(replyPart);


Anyone have an idea?
Thanks for help


Franck

************************ ADSL ILLIMITE TISCALI + TELEPHONE GRATUIT ************************ 
Surfez 40 fois plus vite pour 30EUR/mois seulement !  Et téléphonez partout en France gratuitement,  
vers les postes fixes (hors numéros spéciaux). Tarifs très avantageux vers les mobiles et l'international !
Pour profiter de cette offre exceptionnelle, cliquez ici : http://register.tiscali.fr/adsl  (voir conditions sur le site)