Details
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.