cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pascal Ognibene <pascal.ognib...@libertysurf.fr>
Subject Custom handling of exceptions and SOAP faults with CXF
Date Sat, 01 Nov 2008 10:42:24 GMT
Hi,

I've written a web service implementation (wsdl first) using CXF. This 
service can throw exceptions. Currently they're automatically caught by 
CXF and mapped to a SOAP fault, but I want to include additional 
informations in the SOAP fault message.

I tried with CXF Soap11FaultOutInterceptor, but I only have a Message as 
input; the original exception is not available. And I need it to extract 
informations from this exception and build a custom Fault message.

Basically what I have now is something like:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
       <soap:Fault>
          <faultcode>soap:Server</faultcode>
          <faultstring>Fault occurred while processing.</faultstring>
       </soap:Fault>
    </soap:Body>
</soap:Envelope>

And what I would like to get is:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
       <soap:Fault>
          <faultcode>soap:Server</faultcode>
          <faultstring>1234|param1|param2|param3</faultstring>
       </soap:Fault>
    </soap:Body>
</soap:Envelope>

Where the fault string is custom built using data extracted from the 
initial exception.

BTW I'm using CXF with Spring; don't know if it has an impact.

Any help is welcome.

Pascal

Mime
View raw message