CXF generates WSDL where Fault extends tns: exception

I have a CXF Fault class defined like this:

@WebFault(name = "FaultContainer",
        faultBean = "myapi.transport.FaultContainer",
        targetNamespace = "mynmspace")
public class ServiceFaultSecond extends java.lang.Exception {
...
}

      

As you can see, it extends the Java normal exception. The problem is that in the CXF generated WSDL this class is represented like this:

<xs:complexType name="serviceFaultSecond">
 <xs:complexContent>
  <xs:extension base="tns:exception">
   <xs:sequence>
    <xs:element minOccurs="0" name="faultInfo" type="tns:FaultContainer"/>
   </xs:sequence>
  </xs:extension>
 </xs:complexContent>
</xs:complexType>

      

Here it extends "tns: exception" (thus extending tns: throwable). Now when I try to build a client there are compilation errors - it expects mynmspace.Exception and mynmspace.Throwable instead of java.lang ...

Usually CXF doesn't put the xs: extension element in the WSDL, why is this happening now?

+3


source to share





All Articles