uCosminexus Application Server, Web Service Development Guide

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

16.2.2 com.sun.xml.ws.developer.StreamingAttachment annotation

The description of the com.sun.xml.ws.developer.StreamingAttachment annotation is as follows.

Web Services
This annotation is to be specified in the Web Service using streaming. You can specify the annotation only in the Web Service Implementation Class. If the annotation is specified in SEI, the specification is ignored. If the annotation is specified in the Provider Implementation Class, the operation is not guaranteed.

Web Services client
This annotation is to be specified in the setter method or a field that injects the port. For details, see 10.21.1(4) Enabling features. The annotation will be ignored if you specify the annotation in any other fields or methods.

When creating the Web Service using streaming with the help of the skeleton class of the Web Service Implementation Class generated by the cjwsimport command, the com.sun.xml.ws.developer.StreamingAttachment annotation is not mapped in the Web Service Implementation Class. Therefore, you must specify the com.sun.xml.ws.developer.StreamingAttachment annotation. Note that even if the com.sun.xml.ws.developer.StreamingAttachment annotation is specified in the Web Service Implementation Class, an element or attribute that indicates the usage of streaming does not appear in the WSDL file issued by the Web Service JAX-WS engine or WSDL file generated by the cjwsgen command.

The com.sun.xml.ws.developer.StreamingAttachment annotation is referenced when starting the Web Services. Therefore, this annotation is not interpreted when executing the apt command and the cjwsgen command.

The following figure shows an example of using the com.sun.xml.ws.developer.StreamingAttachment annotation:

Figure 16-12 Example of using the com.sun.xml.ws.developer.StreamingAttachment annotation (Web Services)

[Figure]

Organization of this subsection
(1) dir element (com.sun.xml.ws.developer.StreamingAttachment)
(2) parseEagerly element (com.sun.xml.ws.developer.StreamingAttachment)
(3) memoryThreshold element (com.sun.xml.ws.developer.StreamingAttachment)

(1) dir element (com.sun.xml.ws.developer.StreamingAttachment)

The dir element specifies a directory that is used when you want to output the MIME body that is included in the SOAP message of MIME Multipart/Related structure containing the received attachments when streaming is used in the Web Service, as a temporary file. The default value is a null character ("").

When a null character ("") or null is specified as a default value of the dir element, the output destination for the temporary files is the default temporary file directory for Java (the value corresponding to the java.io.tmpdir key in the system property). Also, if you specify a directory name that does not exist, or a directory name without access rights, or an existing file name, a message is output when starting the Web Service, and the MIME body that is included in the SOAP message of MIME Multipart/Related structure containing the received attachments is extracted to the memory (KDJW10026-W).

(2) parseEagerly element (com.sun.xml.ws.developer.StreamingAttachment)

The parseEagerly element specifies whether to perform the detailed parsing for the SOAP message of MIME Multipart/Related structure containing the received attachments when streaming is used in the Web Service. The default value is false.

(3) memoryThreshold element (com.sun.xml.ws.developer.StreamingAttachment)

The memoryThreshold element specifies the threshold (unit: byte) to decide whether to output the MIME body that is included in the SOAP message of MIME Multipart/Related structure containing the received attachments, as temporary files, when streaming is used in the Web Service. In the memoryThreshold element, specify a value greater than 16KB (16384L) or -1. The operation is not guaranteed if any other value is specified. When -1 is specified, the MIME body is always extracted to the memory. The default value is 1048576L.

For deciding whether to extract the MIME body that is included in the received SOAP message of the MIME Multipart/Related structure to the memory, see 32.3 Temporary files (streaming) .