uCosminexus Application Server, Web Service Development Guide
This subsection describes the settings when you map an attachment to a SOAP message. For details about the mapping rules, check this subsection together with 28.4.2 Precautions on mapping an attachment to a SOAP message (wsi:swaRef format).
The following table describes the values set for the fields and parameters of the HTTP header when attachments are used:
Table 28-5 Values set in the fields and parameters of HTTP header
| No. | Fields name | Parameter name | Settings |
|---|---|---|---|
| 1 | Content-Type | -- | multipart/related is set. |
| 2 | type |
|
|
| 3 | boundary | The boundary string of the MIME part is set. |
When 1 or more non-root MIME parts are enumerated (when SOAP Messages with attachments are sent and received), multipart/related is set in the Content-Type. If there is no MIME part, text/xml is set for the SOAP 1.1 specifications and application/soap+xml is set for the SOAP 1.2 specifications.
The HTTP body consists of the root part, attachment part, and boundary string of each part. The following points describe the contents generated in each part and boundary string and the settings when you use attachments:
The following table lists the values set up in the Content-Type field of the root part when you use attachments:
Table 28-6 Values set up in the root part field
| No. | Field name | Settings |
|---|---|---|
| 1 | Content-Type |
|
| 2 | Content-Id | Globally unique value"+"@"+"jaxws.cosminexus.com is set up. |
When you use attachments, SOAP Envelope is saved in the MIME body of the root part as it is. The CID URL scheme is used as the method for referencing the attachments from the SOAP Body in the SOAP Envelope.
The following is the CID URL scheme type:
"cid:" + Content-Id-of-the-attachment-part |
"CRLF" is set as the boundary string between the MIME header and MIME body of the root part.
The following table describes the values set in the MIME header of the attachment part when attachments are used:
Table 28-7 Values set in the MIME header of the attachment part
| No. | Fields name | Parameter name | Settings |
|---|---|---|---|
| 1 | Content-Type | -- | MIME type#1 is set according to the attachment type. |
| 2 | charset | The character code#2 is specified when the DataHandler object that is generated, is set. | |
| 3 | Content-Transfer-Encoding | None | "binary" is set. |
| 4 | Content-Id | None | "Globally unique value" + "@" + "jaxws.cosminexus.com" is set. |
DataHandler dhandler = new DataHandler ("abcde", "text/plain; charset=Shift_JIS");
|
The binary data indicating the attachment contents is stored in the MIME body of attachment part.
"CRLF" is set as the boundary string of the MIME header and MIME body of the attachment part, as for the root part.
The following string is set as the boundary string between the root part and attachment part and between the attachment parts:
"CRLF" + "--" + "Boundary-parameter-value-of-HTTP-header" |
The following string is set as the end string at the end of MIME part:
"CRLF" + "--" + "<Boundary-parameter-value-of-HTTP-header>" + "--" |
"CRLF" is set as the boundary string between the HTTP header and HTTP body.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.