Hi All,

I have this small Fault handling issue, which is hopefully me doing it wrong
somewhere..
So, I have defined a class WSAuthFault which is thrown by a IN interceptor
and Auth port as well. 
The server side exception hierarchy is defined like this:

@WebFault(name="AuthFault",targetNamespace="exceptions.type.v1.webservices.sl.foo.com")
@XmlAccessorType( XmlAccessType.FIELD )
@XmlRootElement
public class WSAuthFault extends WSBaseFault {

@WebFault(name="BaseFault",
targetNamespace="exceptions.type.v1.webservices.sl.foo.com")
@XmlAccessorType( XmlAccessType.FIELD )
@XmlRootElement
public class WSBaseFault extends WebServiceException

I have a port with a method that explicitly throws this exception as to make
it explicitly available in the in the code generated WSDL, ie:
  public WSMySearchResult getMyData(
      @WebParam(name = "query") WSMySearchCriteria query)
    throws WSBaseFault, WSAuthFault, WSPortSpecificFault; 

This produces a WSDL like this (names changed as I can not use real
names..):
  <wsdl:portType name="MyWService"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
    <wsdl:operation name="getGeofences"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
      <wsdl:input message="tns:getMyData" name="getMyData"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
    </wsdl:input>
      <wsdl:output message="tns:getMyDataResponse" name="getMyDataResponse"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
    </wsdl:output>
      <wsdl:fault message="tns:WSAuthFault" name="WSAuthFault"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
    </wsdl:fault>
      <wsdl:fault message="tns:WSMyPortFault" name="WSMyPortFault"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
    </wsdl:fault>
      <wsdl:fault message="tns:WSBaseFault" name="WSBaseFault"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
    </wsdl:fault>
    </wsdl:operation>

etc.

My problem is that once I use this WSDL on the CXF client side, it all
works, but the WSAuthFault exception is thrown on the client as generic
SOAPFaultException exception instead of WSAuthFault exception I was hoping
to get as that is what the server side throws.

Any help is much appreciated.
Thanks,
-Vitaly

-- 
View this message in context: 
http://old.nabble.com/CXF-client-not-getting-custom-exceptions-thrown-as-defined-by-server-impl-tp26566528p26566528.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to