You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by Andreas Veithen <an...@skynet.be> on 2008/05/30 00:34:29 UTC

[AXIOM] Attachments question

Hi all,

Given an Attachments object, Is there a clean and simple way to  
distinguish the SOAP part from non SOAP parts?

To better understand the question, some background:
* When the Attachments instance is built from an incoming message  
using one of the constructors taking an InputStream as argument, it  
will contain DataHandler objects both for the SOAP (root) part and non  
SOAP parts (the attachments). In this case,  
Attachments#getSOAPPartContentID can be used to identify the SOAP part.
* When the Attachments instance is built programmatically for an  
outgoing message, it will contain only the non SOAP parts (see  
MIMEOutputUtils.writeSOAPWithAttachmentsMessage). However there seems  
to be no (clean) way to distinguish this situation from the first one  
(because Attachments doesn't have a method giving access to the  
noStreams attribute). Also in this case, a call to  
Attachments#getSOAPPartContentID will result in a NullPointerException  
(because the contentType attribute is null).

Regards,

Andreas