uCosminexus Application Server, Web Service Development Guide
This subsection describes the Java types for which attachments are specified in the Java interface.
The following table describes the usability of Java type of attachments in the Java interface:
You need to add javax.xml.bind.annotation.XmlAttachmentRef annotation in the Java types that can be used in attachments. If you add this annotation in the types that cannot be used in attachments, the operations might not function properly.
Table 28-1 Usability of Java types as attachments
| No. | Java type | Usability |
|---|---|---|
| 1 | javax.activation.DataHandler | Y |
| 2 | javax.xml.ws.Holder<DataHandler> | Y |
| 3 | Array type of javax.activation.DataHandler | R |
| 4 | Array type of javax.xml.ws.Holder<DataHandler> | N |
| 5 | Data type that inherits javax.activation.DataHandler | N |
You can specify an attachment in the fields of the method argument, method return value, and user-defined type of Java interface. You cannot specify an attachment in a user-defined exception.
The following table describes the location for specifying an attachment in the Java interface and the whether the Java type can be specified:
Table 28-2 Location of specification and specifiability of Java types of attachments
| No. | Location of specification in the Java interface | Java type of attachment | Can be specified or not |
|---|---|---|---|
| 1 | Method arguments | javax.activation.DataHandler | Y |
| 2 | javax.xml.ws.Holder<DataHandler> | Y | |
| 3 | Array type of javax.activation.DataHandler | R | |
| 4 | Method return values | javax.activation.DataHandler | Y |
| 5 | javax.xml.ws.Holder<DataHandler> | N | |
| 6 | Array type of javax.activation.DataHandler | R | |
| 7 | Fields of the user-defined types | javax.activation.DataHandler | Y |
| 8 | javax.xml.ws.Holder<DataHandler> | N | |
| 9 | Array type of javax.activation.DataHandler | R | |
| 10 | Fields of the user-defined exceptions | javax.activation.DataHandler | N |
| 11 | javax.xml.ws.Holder<DataHandler> | N | |
| 12 | Array type of javax.activation.DataHandler | N |
The javax.activation.DataHandler type is a type of JavaBeans Activation Framework (JAF), so you can specify any MIME type attachment. For details on the extensions for the attachments and the MIME type mapping set up by default, see 28.4.2(3) Mapping between the attachment extension and MIME types.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.