You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Dittmann Werner <we...@siemens.com> on 2003/10/22 12:41:14 UTC

Problems with attachments (SOAP with Attachments)

Hi,

during some tests with SOAP with Attachments (SwA) using WSDL I
discovered some problems regarding attachment handling.

The attachment is a mutlipart/mixed that is part of the overall
multipart/related message (see attached example).

The service contains the method swaSend that gets a decoded
MimeMultipart from Axis. Because Axis creates temporary files during
attachment handling, I added some code to delete the temporary file
after processing of the attachment was done. However, the dispose()
method in AttachmentPart didn't delete the temporary attachment
file. The follwing bugs were found:

- the variable "attachmentFile" was not properly set when attachment
  parts are created with "ManagedMemoryDataSource" as the data source
  of DataHandler.

- After fixing this bug the f.delete() call in dispose() returned
  false, i.e. didn't delete the temporary attachment file. 

  I enhanced the dispose to call the ManagedMemoryDataSource specific
  delete function if the data source is of that type.

  BTW, some further tracking showed that the temporary file was not
  properly closed. In MimeMultipartDataHandlerDeserializer.startElement()
  the MimeMultipart parses the input. It seems that the parse does
  not close the inputstream (not an Axis problem).

The attachment contains the full SwA example and the patch to fix the
mentioned bugs (hope the patch is in the correct format because I 
don't have a real CVS environment).

Regards,
Werner

Werner Dittmann
Siemens ICM N AS BD E
mailto:Werner.Dittmann@siemens.com
Tel:   +49(0)89 636 50265
Mobil: +49(0)172 85 85 245