cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jian wu" <hellojia...@gmail.com>
Subject Re: How to throw a user defiend exception from a service interface
Date Sun, 21 Sep 2008 08:01:01 GMT
Hi,

If you are using JAX-WS, you can use "WebFault" annotation with
the "MyException", Your Web Service Definition would be sth like:
============================================
// MyService.java
@WebService
public interface MyService {

@WebMethod
MyResponse MyMethod( ...) throws MyException;

}

// MyException.java
@WebFault( ... )
public class MyException extends Exception {
}
============================================

Hope this would be helpful.

Jian

On Fri, Sep 19, 2008 at 9:30 PM, FireElement <pire_cao@163.com> wrote:
>
> I define a web service using cxf, and my interface could throw MyException
> which is inherited Excetpion. But when the exception is throw, from the
> client side, I could only catch a SOAPFaultExceptioin but not MyException.
> Who can give me a example about how to throw out a user defined Exception.
> Thanks a lot!
> --
> View this message in context: http://www.nabble.com/How-to-throw-a-user-defiend-exception-from-a-service-interface-tp19582586p19582586.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Mime
View raw message