uCosminexus Application Server, Web Service Development Guide

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

28.1 What is the attachment functionality (wsi:swaRef format)

The attachment functionality is a functionality that sends and receives SOAP Messages with attachments wherein text and image (binary data) files are attached to SOAP Messages.

This section provides an overview of the attachment functionality based on the following example:

Figure 28-1 Sending and receiving binary data using the attachment functionality

[Figure]

To attach a file to the SOAP Message, use javax.activation.DataHandler class in an argument of Java method that invokes the Web Service. A Java source with a file attached is marshalled by the SOAP Messages using the sending JAX-WS engine and is un-marshalled by the Java source using the receiving JAX-WS engine. The receiving JAX-WS engine obtains the attachment from the argument of the un-marshalled Java source method.

Note that this functionality complies with WS-I Attachments Profile - Version 1.0 specifications; therefore, WSDL of wsi:swaRef type is used. Also, since the SOAP Messages with Attachments protocol is used; the SOAP Messages with attachments are encoded using the MIME Multipart/ Related structure.

To send and receive SOAP messages with attachments, using the APIs of the SAAJ 1.3 specifications, see the section 22.1 Support range of the SAAJ 1.3 specifications.