Search code examples
javasoapcxfjax-ws

How to avoid message: "Operation getFaultSubCodes not supported by SOAP 1.1" with CXF


My java webapp use CXF to publish some web services with SOAP 1.1.

In my server logs (Apache Tomcat catalina.out file), I get occurrences of: GRAVE: SAAJ0303: Operation getFaultSubcodes not supported by SOAP 1.1

Those log lines occurs each time the java webapp business code throws an instance of javax.xml.ws.soap.SOAPFaultException. This exception is handled by Apache CXF org.apache.cxf.jaxws.interceptors.WebFaultOutInterceptor, which call getFaultSubcodes on the SOAPFault instance.

With SOAP 1.1 SOAPFault, the call to getFaultSubcodes throws an UnsupportedOperationException, catched by CXF, but the implementation class of SOAPFault log the message. Is there a SOAP 1.1 specific CXF fault interceptor?

Does anyone know a way to avoid CXF calling the unsupported GetFaultSubcodes operation?


Solution

  • Here's a nice explanation and here's the related (resolved) issue reported on July 25, 2017.

    You have at least these two solutions:

    1. If the SOAP fault is created in your code, pass the protocol version 1.2 when instantiating the factory used to create the fault. Note from the OP's comment: You may need to modify SOAP faultCode field value when instanciating SOAPFaultException if using this solution. SOAP 1.1 and 1.2 have different values for faultCode field.

    SOAPFactory fac = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);

    1. If you can, use newer CXF version - at least 3.0.15, 3.1.13 or 3.2.0. (all released on September 11th, 2017)