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

Outbound XSD validation fails using javax.xml.ws.Provider

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.7, 2.7.8, 2.7.9, 2.7.10
    • Fix Version/s: 3.0, 2.7.12
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      When an endpoint is published backed by a javax.xml.ws.Provider<Source> and Message.SCHEMA_VALIDATION_ENABLED is set to "BOTH", then returning a soap:Fault from that Provider will cause the exchange to fail with the following exception:

      WARNING: Interceptor for {http://www.examples.com/wsdl/HelloService.wsdl}Hello_Service#{http://www.examples.com/wsdl/HelloService.wsdl}sayHello has thrown exception, unwinding now
      org.apache.cxf.interceptor.Fault: Could not generate the XML stream caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'soap:Fault'..
      	at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:99)
      	at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:54)
      	at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:48)
      	at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:123)
      	at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
      	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
      	at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77)
      	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
      	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
      	at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:355)
      

      The following is observed:

      When the same soap:Fault is "returned" (thrown) from a Java SEI implementation, the issue does not reproduce.

      When SCHEMA_VALIDATION_ENABLED is set to "FALSE" or "IN", the issue does not reproduce.

      The issue is reproducible on 2.7.7, 2.7.8, 2.7.9, 2.7.10 and 2.7.11.

      The issue is not reproducible on 2.7.6.

      I'll attach a simplified Maven test case for this issue.

        Attachments

        1. CXF-5686-fault-validation.zip
          7 kB
          Eirik Bjorsnos

          Activity

            People

            • Assignee:
              dkulp Daniel Kulp
              Reporter:
              eirbjo Eirik Bjorsnos
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: