uCosminexus Application Server, Web Service Development Guide

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

30.7.2 How to acquire the received data

If the data received through an attachment in the MTOM/XOP specification format is other than the javax.activation.DataHandler object (byte[], java.awt.Image object, or javax.xml.transform.Source instance), the JAXB converts the received data into an appropriate Java object. Therefore, you need not convert the data in an application.

If the received data is a javax.activation.DataHandler object, you can acquire the received data by using the same method as that for an attachment in the wsi:swaRef format.

For details on how to acquire an attachment in the wsi:swaRef format, see 28.5.2 How to acquire the attachment data (wsi:swaRef format).

Organization of this subsection
(1) Notes on acquiring the javax.activation.DataHandler object
(2) Notes on acquiring the javax.xml.transform.Source object

(1) Notes on acquiring the javax.activation.DataHandler object

Receiving a SOAP message of the MIME Multipart or related structure that contains an attachment in the MTOM and XOP specification format enables you to handle a SOAP message as an attachment of the streamed MTOM/XOP specification format. Because the receiving process does not complete at the receiver side of the attachment in the MTOM/XOP format unless all the data is imported from the input stream contained in the javax.activation.DataHandler object, the sending process at sender side waits until the receiving process completes at the receiving side.

To come out of this state, you must either import all the data from the java.io.InputStream object contained in the javax.activation.DataHandler object or export the imported streamed data to the output stream by using the writeTo(java.io.OutputStream) method of the javax.activation.DataHandler class.

(2) Notes on acquiring the javax.xml.transform.Source object

When the data received in an attachment in the MTOM/XOP specification format is the javax.xml.transform.Source object, you can handle the data as an attachment in the streamed MTOM/XOP specification format. The JAXB converts the javax.xml.transform.Source object into the javax.xml.transform.stream.StreamSource object.

Because the receiving process does not complete at the receiving side of the attachment in the MTOM and XOP specification format unless all the data is imported from the input stream contained in the javax.xml.transform.stream.StreamSource object, the sending process at the sender side waits until the receiving process completes at the receiving side.

To eliminate this state, you must import all the data from the java.io.Reader object contained in the javax.xml.transform.stream.StreamSource object.