uCosminexus Application Server, Web Service Development Guide
This subsection describes the settings required for mapping the attachments to the SOAP messages. For the mapping conventions, also see 30.5.2 Notes on mapping from the attachments to the SOAP messages (MTOM/XOP).
The following table lists the values that are set in the HTTP header field and parameters when attachments in MTOM/XOP specification format are used.
Table 30-6 HTTP header fields and parameter settings
| No. | Field name | Parameter name | Settings |
|---|---|---|---|
| 1 | Content-Type | -- | "multipart/related" is set.# |
| 2 | start | Route part Content-Id is set. | |
| 3 | type | "application/soap+xml" is set. | |
| 4 | boundary | MIME part border string is set. | |
| 5 | start-info |
|
HTTP body has a route part, an attachment part, and the border strings between each part. This section describes the contents generated in each part and the values set when using the attachments.
The following table lists the values that are set in the route part fields when using the attachments.
Table 30-7 Route part fields and parameter settings
| No. | Field name | Parameter name | Settings |
|---|---|---|---|
| 1 | Content-Type | -- | "application/xop+xml" is set. |
| 2 | charset | "utf-8" is set. | |
| 3 | type |
|
|
| 4 | Content-Transfer-Encoding | None | "binary" is set. |
| 5 | Content-Id | None | "rootpart*"+" globally unique value "+"@"+"jaxws.cosminexus.com" is set. |
When using attachments, SOAP envelope is stored as is in the MIME body of the route part. XOP is used for referencing the MTOM/XOP specification format attachments from the SOAP body that exists inside the SOAP envelope.
The following table lists the values that are set in the MIME header of the attachment part when using attachments.
Table 30-8 Attachment part fields and parameter settings
| No. | Field name | Parameter name | Settings |
|---|---|---|---|
| 1 | Content-Type | -- | Text expression of the MIME type specified in the value element of the XmlMimeType annotation is set.#1, #2, #3 |
| 2 | charset | If the target of MTOM/XOP specification format attachments is Source type, "UTF-8" is set.#4 If the target of MTOM/XOP specification format attachments is DataHandler type, the character code specified when generating the DataHandler object is set.#5 If the target of MTOM/XOP specification format attachments is a Java type other than those mentioned above, the parameter does not appear. |
|
| 3 | Content-Transfer-Encoding | None | "binary" is set. |
| 4 | Content-Id | None | "globally unique value"+"@"+"jaxws.cosminexus.com" is set. |
DataHandler dhandler = new DataHandler ("Double byte character", "text/plain; charset=Shift_JIS");
|
The javax.activation.DataHandler Java type of MTOM/XOP specification format attachment is a JavaBeans Activation Framework(JAF) type same as the javax.activation.DataHandler Java type that can be used as wsi:swaRef format attachment. Hence, you can specify attachment data of any MIME type for the javax.activation.DataHandler type.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.