uCosminexus Application Server, Web Service Development Guide
The availability of attachments in MTOM/XOP specification format in the Web Service side JAX-WS engine depends upon the field value of the SOAPBinding interface specified in the javax.xml.ws.soap.MTOM annotation or javax.xml.ws.BindingType annotation specified in the Web Service implementation class. The following table describes the usage of attachments in MTOM/XOP specification format, and the behavior upon receiving the request messages:
Table 30-2 Availability of attachments in MTOM/XOP specification format and the behavior upon receiving the request messages
| No. | Attachment in MTOM/XOP specification format | Data included in the received messages | Successfully received/failed | Relation between the threshold and the attachment to be sent# | Data included in the response messages to be sent |
|---|---|---|---|---|---|
| 1 | Used | Binary data | Successful | Threshold |
Binary data |
| 2 | Base64 type data | Successful | Threshold>attachment size | ||
| 3 | Not used | Binary data | Successful | None | Base64 type data |
| 4 | Base64 type data | Successful | None |
If the javax.xml.ws.soap.MTOM annotation is not specified in the Web Service implementation class, or if SOAPBinding.SOAP11HTTP_MTOM_BINDING and SOAPBinding.SOAP12HTTP_MTOM_BINDING are not specified in the field values of the SOAPBinding interface that is specified in the javax.xml.ws.BindingType annotation, attachments in MTOM/XOP specification format are not used. Irrespective of whether binary data is included, all request messages are received. Also, response messages with Base64 type data are sent.
Depending upon whether the javax.xml.bind.annotation.XmlMimeType annotation, which links Java type and MIME type, is annotated or not annotated in SEI etc, the value of the Content-Type field in the attachment part of the messages sent through the attachments in MTOM/XOP specification format changes. See below for how the Content-Type value in the attachment part changes depending upon whether the javax.xml.bind.annotation.XmlMimeType annotation is used.
Table 30-3 Content-Type initial values corresponding Java type
| No. | Java type | Content-Type initial value |
|---|---|---|
| 1 | java.awt.Image | image/png |
| 2 | javax.xml.transform.Source | application/xml |
| 3 | javax.activation.DataHandler | javax.activation.DataHandler object MIME type# |
| 4 | Array type of java.awt.Image | image/png |
| 5 | Array type of javax.activation.DataHandler | javax.activation.DataHandler object MIME type# |
| 6 | java.util.List<Image> | image/png |
| 7 | java.util.List<DataHandler> | javax.activation.DataHandler object MIME type# |
| 8 | javax.xml.ws.Holder<Image> | image/png |
| 9 | javax.xml.ws.Holder<Source> | application/xml |
| 10 | javax.xml.ws.Holder<DataHandler> | javax.activation.DataHandler object MIME type# |
| 11 | byte[] | application/octet-stream |
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.