2 Replies Latest reply on Sep 2, 2013 1:56 PM by julymonday

    MTOM XOP attachments missing

    dzcs

      Hello Together,

      I hope enybody have had already the issue and solved it.

      The issue:

      I have implemented some webservice client in standard way having wsdl, having port (with mtom annotation) and service. In XSD needed parts set to type base64 and xsi:mimeType also set:

       

      <xs:element name="Document" type="xs:base64Binary" xmime:expectedContentTypes="*/*" />

       

      In JAXB classes DataHandler used and XmlMimeType respectivelly.

       

      @XmlElement(name = "Document")

      @XmlMimeType("*/*")

      protected DataHandler document;

       

      In proxy class I am setting MTOM enabled for binding.

       

      First of all I was running the client in JDK (where standard JAX-WS implementation is from Sun). Runs perfectly. Then I used the library in JBoss 7.2 (cxf) and I missed attached documents. So I used the same apache-cxf library on JDK and have the same problem - means that handling in CXF ist different than in metro.

       

      In proxy class I set also timeouts to request context - nothing happend. I am using SOAPHandlers - can it be a problem? Because I know now, that cxf based on streaming so if I am reading content of messages it probably can cause problems.

       

      But still it is not clear why the same peace of code based on standards works with standard jdk and doesnot work with CXF.

       

      Does anybody had same issues with MTOM and XOP?

      Thank you in advance!

        • 1. Re: MTOM XOP attachments missing
          dzcs

          Hi guys, solution was simple. As soon as I read, that cxf is streaming based I understood the cause of problem. One of the functionality, which my client is providing is that the user can see SOAP conversation as a part of invocation result. So I had special SOAPHandler which before JAXB demarschalling had dumped messages to provide later that conversation. What I changed - I added lazy dumping, so it will normally take place after JAXB demarschalling. Only difference which I have richt now to Metro is that in dumped message all attachments are empty. But it is not that bad. Because normally you are interrested in SOAP itself.

           

          Anyway thank you for attention.

          • 2. Re: MTOM XOP attachments missing
            julymonday

            Hello!

            I seem to have the same problem and no solution so far.

             

            I'm running JBoss EAP 6.1.0 Final (== JBoss AS 7.2 Final) with JBossWS 4.1.3

            The  annotation of the data is:

            @XmlMimeType("application/octet-stream")

            @XmlElement(name="data")

            public DataHandler data;

             

            If the handler is active, the SOAP dump contains the reference, but no data:

            <data>

            <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:41e8918d-0ced-47e1-9dc8-ed7aaa350411-1@cxf.apache.org"/>

            </data>

             

            However, if the handler is NOT active, the result is the same - no data.

             

            So, any insight would be greatly appreciated.