Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-3775

MTOM attachment lost by SimpleWebServiceInboundGateway


    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 4.1.6
    • Fix Version/s: None
    • Component/s: Web Services
    • Labels:


      I don't know if this is a bug or an unavoidable problem (in which case, probably a mention in the documentation would be useful).
      I want to receive a message from a web service inbound gateway and unmarshal it with JAXB2. The incoming message contains a MTOM attachment.

      Given that I have configured Spring Web Services and my JAXB2 unmarshaller in order to enable MTOM support, I then have two possibilities:

      • use a MarshallingWebServiceInboundGateway by specifying my MTOM-enabled (un)marshaller on the int-ws:inbound-gateway> tag
      • use a SimpleWebServiceInboundGateway (i.e.: no (un)marshaller specified on the tag) and then connect it to an UnmarshallingTransformer which uses my MTOM-enabled (un)marshaller

      The second solution may allow to perform some extra processing between the receiving of the SOAP message body and its unmarshalling and in any case (if no such extra processing is performed) I would expect it to be equivalent to the first solution.
      But what I observe is that in the second case the MTOM attachment is lost: the InputStream of the DataHandler of the field corresponding to the XSD element of the binary attachment in the JAXBElement instance that constitutes the unmarshalled payload, returns no bytes. The rest of the XML message is intact.


          Issue Links



              • Assignee:
                abilan Artem Bilan
                mauromol Mauro Molinari
              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: