axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarmo Doc" <>
Subject RE: Exceptions are killing me
Date Thu, 12 Jan 2006 19:46:15 GMT
Apologies, I attached the wrong serialization -- that one was from an 
exception that derived from Exception rather thanAxisFault (I've tried both 
and neither works unless you happening to be talking to an Axis cleint).

Here's the serialization (that's still wrong) derving from AxisFault:

<soapenv:Fault xmlns:soapenv="">
    <ns1:fault xmlns:ns1="mypackage">
     <ns2:mytext xmlns:ns2="mypackage">testing exceptions</ns2:mytext>
    <ns5:stackTrace xmlns:ns5="">
    ... stack trace here ...

Aside from 'exceptionName' which I believe is an old hack to allow Axis 
clients (and only Axis clients) to work out what type the exception is, this 
fault does not indicate the type of the embedded exception.

Should not:

  <ns1:fault xmlns:ns1="mypackage">

instead be something like this:

  <ns1:fault xmlns:ns1="mypackage" type="MyException">

How do I correct this behavior?

>From: "Jarmo Doc" <>
>Subject: Exceptions are killing me
>Date: Thu, 12 Jan 2006 11:16:15 -0800
>My Axis 1.3 server operations throw MyException which is defined something 
>like this (though in reality it's more complex):
>public class MyException extends AxisFault implements Serializable
>  private String mytext;
>  public String getMytext() {return mytext;}
>  public void setMytext(String mytext) {this.mytext = mytext;}
>  // the normal wsdl2java generated stuff such
>  // as constructor, getSerializer(), getDeserializer()
>I see this serialized on the line as:
><soapenv:Fault xmlns:soapenv="">
>   <faultcode>soapenv:Server.userException</faultcode>
>   <faultstring>mypackage.MyException</faultstring>
>   <detail>
>    <faultData>
>     <mytext>testing exceptions</mytext>
>    </faultData>
>    <ns1:stackTrace
>    ... stack trace here ...
>    </ns1:stackTrace>
>    <ns2:hostname 
>    </detail>
>I'm not an expert here, obviously, but I'm pretty sure that this 
>serialization is wrong.  In particular:
>1. the fault string is the name of the exception class, which is odd
>2. it refers to <faultData> when I'd expect to see <ns1:MyException> or 
>3. it should not contain a server-side stack trace
>As it stands, a client that attempts to deserialize this has no clue what 
>type the contained exception is and thus fails.
>My cubicle wall now has a large hole from me banging my head into it on a 
>regular basis ;-) so could someone please offer a clue as to what could be 
>going wrong.  What could cause Axis to serialize my exception in this way?

On the road to retirement? Check out MSN Life Events for advice on how to 
get there!

View raw message