Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7952

MTOM + schema validation creates invalid SOAP FAULT response

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.6, 3.2.7
    • 3.3.6, 3.4.0
    • The service itself is running as a WAR deployment on Ubuntu 16.04 LTS within a Apache Tomcat 8.5.32 using JDK 1.8.0_161.

    • Unknown

    Description

      Hello! We had built a jaxws webservice based on cxf 3.2.6/3.2.7. The Java code was created from a given WSDL by using the maven plugin "cxf-codegen-plugin". In the provided cxf-servlet.xml on server side there is both mtom and schema validation enabled on the jaxws:endpoint definition:

      <jaxws:properties>
          <entry key="schema-validation-enabled" value="true" />
          <entry key="mtom-enabled" value="true"/>
      </jaxws:properties>
      

      In case of an invalid validation result (see attachment server_validation.txt) it seems, that the created SOAP FAULT message is corrupt so that the client could not parse the message (see attachment error.txt):

      javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader: Unexpected character '-' (code 45) in prolog; expected '<'
      at [row,col {unknown-source}]: [2,1]
      [...]
      Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'
      at [row,col {unknown-source}]: [2,1]
      at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:653)
      at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2133)
      at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1181)
      at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1204)
      at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:173)

      The message itself seems to contain an additional, non referenced boundary (see attachment client_fault.txt).

      What might be the problem here? If we deactivate the complete MTOM feature by removing it from the endpoint definition the fault message could be successfully processed.

      Thanks in andvance!

       

      Attachments

        1. server_validation.txt
          8 kB
          Tobias Held
        2. error.txt
          2 kB
          Tobias Held
        3. client_fault.txt
          1 kB
          Tobias Held

        Activity

          People

            ffang Freeman Yue Fang
            theld Tobias Held
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: