Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-4602

JAX-WS MTOM issue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 1.7.0
    • None
    • jaxws
    • None

    Description

      In Axis2 JAX-WS implementation, org.apache.axis2.jaxws.message.Block is extending OMDataSourceExt. In the response messages of normal invocations, this object is kept inside the body of the SOAPEnvelope and directly serialized without building the OMElement. In order to handle MTOM, it uses the JAXBAttachmentMarshaller which writes data handler objects into the MTOMXMLStreamWriter.

      MTOM works fine as far as the return OMElement is not built and directly serialized using the OMDataSource. But if the OMElement is built by some handler on the return path, JAXB Block is written to a ByteArrayOutputStream and read as a ByteArray (through the getReader() method of BlockImpl). Therefore, the OMElement which is built using this ByteArray, doesn't know about MTOM. So, the response is given as base64 (inline).

      So even though the service is MTOM enabled, if some handler (Ex: Security) builds the body element, the binary response data is transmitted as base64-encoded inline, instead of as a separate binary attachment (see below - I remove most of the returned data due to its length):

      --MIMEBoundaryurn_uuid_6A41A9AB6F9E3EEAB71262792774662
      Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
      Content-Transfer-Encoding: binary
      Content-ID: <0.urn:uuid:6A41A9AB6F9E3EEAB71262792774663@apache.org>

      <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><dlwmin:getBinaryTestDataResponse xmlns:dlwmin="urn:ca.dmf.webservices"><return>f39/f39/f39/f39...</return></dlwmin:getBinaryTestDataResponse></soapenv:Body></soapenv:Envelope>
      -MIMEBoundaryurn_uuid_6A41A9AB6F9E3EEAB71262792774662-

      Attachments

        1. jaxws-mtom-fix.txt
          14 kB
          Isuru Suriarachchi

        Issue Links

          Activity

            People

              Unassigned Unassigned
              isurues Isuru Suriarachchi
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: