I've put support into WSIF for unreferenced attachments because for
document style it is usual for people not to reference attachments. By
unreferenced attachments, I mean attachments that are not referenced from
the soap body. I would prefer to implement this support by determining from
the WSDL whether an attachment is referenced or not, but the specs are
unclear as to how to do this. I asked on axis-user/wsif-dev a few days ago
how axis were intending to support this, but I got no response. So my
current implementation avoids using an interpretation of the specs to
determine this from the WSDL, lest other projects make opposite assumptions
and WSIF becomes incompatible with them.

Consequently, WSIF now expects that unreferenced attachments are not
defined in the WSDL, although it tolerates mime:part's that have no
corresponding part in the input message. Unreferenced attachments are
passed to WSIF (using the DII) as a List of WSIFAttachmentPart's on the
input/output messages. A WSIFAttachmentPart encapsulates the DataHandler
and the mime headers. Mime headers set on a WSIFAttachmentPart are set on
the outgoing mime attachment. The advantage of using a
org.apache.wsif.WSIFAttachmentPart instead of a
org.apache.axis.attachments.AttachmentPart or a
javax.xml.soap.AttachmentPart is that a WSIFAttachmentPart is binding
independent and so enables attachment data to be passed to
Java/EJB/NativeJms services without the need to have axis.jar on the
classpath. The support for unreferenced attachments can be switched on/off
using wsif.unreferencedattachments=on|off in wsif.properties and the
default is off. I have disabled it by default since I view this support as
a short-term solution, until the proper solution becomes clear.

Mark
Mark Whitlock, IBM Hursley Web Services


Reply via email to