uCosminexus Application Server, Web Service Development Guide

[Contents][Glossary][Index][Back][Next]

28.2 Java interface of attachments (wsi:swaRef format)

This subsection describes the Java types for which attachments are specified in the Java interface.

Organization of this section
(1) Java types that can be used in attachments
(2) Locations in which attachments can be specified
(3) Attachment that can be specified in javax.activation.DataHandler type

(1) Java types that can be used in attachments

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

Legend:
Y: Can be used as attachment.
R: Only one-dimensional array can be used as attachment. If a multi-dimensional array is used, the operations might not function properly.
N: Cannot be used as attachment.

(2) Locations in which attachments can be specified

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

Legend:
Y: Can be specified.
R: Can be specified only when one-dimensional array is used. If specified using a multi-dimensional array, the operations might not function properly.
N: Cannot be specified.

(3) Attachment that can be specified in javax.activation.DataHandler type

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.