cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Eduardo Rodrigues de Almeida" <eduardo.alme...@gmail.com>
Subject Re: Custom Exceptions mapping to SOAP Faults
Date Fri, 12 Sep 2008 14:29:53 GMT
Thank you Daniel!! It worked!!

Eduardo Almeida


On Thu, Sep 11, 2008 at 2:50 PM, Daniel Kulp <dkulp@apache.org> wrote:
>
> This is one of the "bizzare" things in the JAX-WS spec.     By default, it's
> always "server".   However, you can control things if you set the "cause" of
> the custom exception to a javax.xml.ws.soap.SOAPFaultException  that has the
> fault code and such in it.   Note: the fault string then comes from that
> SOAPFaultException as well.
>
>
> Dan
>
>
> On Tuesday 09 September 2008 4:04:56 pm Carlos Eduardo Rodrigues de Almeida
> wrote:
>> Hi all,
>>
>> I have a web service that throws a custom Exception, like:
>>
>> public interface SimpleService
>>     public int getId(String user, String password) throws
>> WrongUserException; }
>>
>> public class WrongUserException extends Exception{
>>     private int transactionId;
>>
>>     public WrongUserException(String message) {
>>         super(message);
>>     }
>>
>>     public int getTransactionId() {
>>          return transactionId;
>>     }
>> }
>>
>> This exception is mapped to a fault, the transactionId is mapped to
>> the faultDetails, the message is mapped to the faultString but I´m not
>> able to change the faultCode, it is always Server. I would like to map
>> it to Client.Authentication for example.
>>
>> I´m using CXF with Spring.
>>
>> Thank you,
>> Eduardo
>
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>

Mime
View raw message