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 Franck Leplé <le...@tiscali.fr> on 2004/11/15 14:53:41 UTC

Compressed attachment file locked

    Hello,
Since I didn't get any response I thought I should try again.I have created
some Web Services with compressed attachments. The problem is on the 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);-----------------------------------------An
yone have an idea?Thanks for helpFranck