axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Spinelli <>
Subject Re: axis2 - creating a customer exception
Date Fri, 12 Dec 2008 10:53:57 GMT ha scritto:
> I have created a custom exception and it is being throw by the web 
> service. The exception has two fields and getter and setter methods 
> for those fields. Those fields are being set by the service before it 
> throws the customer exception.  On the client side, the only exception 
> I am able to catch is  AxisFault exception. In that class, I cannot 
> seem to find the custom exception I threw, or the fields I set on the 
> custom exception.
> Background:
> I am creating the web service from POJO's and a services.xml file. The 
> WSDL is auto generated when I deploy the web service to axis2 inside 
> of Tomcat.  Therefore, I have no control over the content of the WSDL.
> I am also using Axis2 to create the client. I am using the wsdl2java 
> utility the auto generates the Stub class from the WSDL.  I have 
> googled this issue and by all accounts it seems that catching an 
> AxisFault exception is what the client should do if using Axis2 to 
> autogenerate the stubs from the WSDL. But how do i access the custom 
> exception I threw and access the fields I set on the custom exception?   
I would like to point out that in axis1, in the same situation, the 
exception was re-generated at the client side without problems.

As an example, if I have a class

class A {

  public b() throws C {



class C extends Exception {
  public String getFoo() ...
  public int getBar() ...

and I use it as the service provider class, i.e. in services.xml I say

    <parameter name="ServiceClass"> A </parameter>

... then in the wsdl I should see (without namespaces)

   <operation name="b">

      <fault message="C" name="C" />


and if b raises the exception C the output is something like











This is what's happening in Axis1.

In axis2 all I get is

     <soapenv:Text xml:lang="en-US">
          ... the error message 

why ???

I see this is a well-known issue

and that the assignee is Deepal. Any news?

If nothing has happened yet, I can try to develop a patch (maybe using 
code from axis1),
but someone in the development team should show some interest.


dott. Andrea Spinelli - IMTeam
phone: +39-035-636029
fax: +39-035-638129
IANA enterprise number:

View raw message