I am using CXF on Tomcat 6.0.18 and have created my webservice using
JAX-WS annotations. I need to throw my own exception from this
webservice because I need to have custom fields in it.

However, in the WSDL being created by CXF my custom exception is not
including the extra fields. What am I doing wrong?

My exception looks something like this:

 

public class MyException extends Exception

{

    int faultCode;

 

    public MyException(String desc, int faultCode)

    {

         super (desc);

         this.faultCode = faultCode;

     }

 

     public int getFaultCode()

     {

        return faultCode;

     }

}

 

 

My Webservice looks like this:

 

@WebService

public class MyWebservice

{

   @WebMethod

   public void myMethod()

           throws MyException 

}

 

Isnt this the proper way to throw an exception with JAX-WS? Is CXF doing
something it shouldn't or am I missing something?

 

Thanks,

 

Josef

Reply via email to