cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From imorales <imora...@ignos.com>
Subject Re: Custom exceptions in CXF web-service
Date Wed, 28 Nov 2007 08:58:15 GMT

Well that it´s a bug --> https://issues.apache.org/jira/browse/CXF-1028
But I don´t understand because my cxf version is 2.0.2 and the bug is fixed
for that version.

imorales wrote:
> 
> Hi all. I developed a web service using CXF. The methods of the web
> service throws Custom Exceptions. Something like that:
> 
> -----------------------------------------------------------------------------------------
> @WebResult(name="ticket")
> Long iniciaFormulario( @WebParam(name="xslt") String xslt) throws
> MetaInformacionException;
> -----------------------------------------------------------------------------------------
> 
> And MetaInformacionException extends of Exception.
> 
> The problem is that when in my server throw a new MetaInformacionException
> the client never catch the exception because the excepction that occurs is
> a "javax.xml.rpc.soap.SOAPFaultException" but with the message of my
> custom Exception.
> 
> The client is developed with ant task WSDL2JAVA and this task generates a
> class called "MetaInformacionException_Exception". Here is the code.
> 
> The MetaInformacionException that I developed:
> -----------------------------------------------------------------------------------------
> public class MetaInformacionException extends Exception{
>     private static final long serialVersionUID = 1L;
>     public MetaInformacionException() {
>         super();
>     }
>     public MetaInformacionException(String msg) {
>         super(msg);
>     }
>     public MetaInformacionException(String msg, Throwable cause) {
>         super(msg, cause);
>     }
> }
> -----------------------------------------------------------------------------------------
> 
> And the class that the WSDL2JAVA generate:
> -----------------------------------------------------------------------------------------
> @WebFault(name = "MetaInformacionException", targetNamespace =
> "http://servicios.ignos.com/")
> 
> public class MetaInformacionException_Exception extends Exception {
>     public static final long serialVersionUID = 20071108142126L;
>     
>     private com.servicios.MetaInformacionException
> metaInformacionException;
> 
>     public MetaInformacionException_Exception (String message) {
>         super(message);
>     }
> 
>     public MetaInformacionException_Exception (String message,
> com.servicios.MetaInformacionException metaInformacionException) {
>         super(message);
>         this.metaInformacionException = metaInformacionException;
>     }
> 
>     public MetaInformacionException_Exception (String message,
> com.servicios.MetaInformacionException metaInformacionException, Throwable
> cause) {
>         super(message, cause);
>         this.metaInformacionException = metaInformacionException;
>     }
> 
>     public com.servicios.MetaInformacionException getFaultInfo() {
>         return this.metaInformacionException;
>     }
> }
> ------------------------------------------------------------------------------------------
> Why the exception that throws the server is never catched by the client
> ???
> 
> Any ideas?. Thanks in advance.
> 

-- 
View this message in context: http://www.nabble.com/Custom-exceptions-in-CXF-web-service-tf4887017.html#a13988371
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message