You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jarmo Doc <ja...@hotmail.com> on 2006/01/11 00:24:52 UTC

Major issues with Axis 1.3 Faults?

Regardless of whether I throw a user-defined exception (derived from 
java.lang.Exception) or an AxisFault, there appear to be two fatal problems 
with Axis server-side processing of faults.

My investigation indicates that when a custom exception is thrown:

1. the Axis server returns a 500 internal server error and 
"connection:close" to the client

I don't have a problem with the 500 error but I do have a problem with the 
"connection:close".  Why should the connection be closed?  All I did was 
return a SOAP fault which is not typically an indication of a serious error 
requiring session termination (or is it?)

2. the serialized fault detail does not contain a type so cannot be 
deserialized correctly, e.g. by gSOAP

While an Axis client can deserialize my custom exception, a gSOAP C++ client 
cannot.  The problem appears to lie in the 'fault' element.  It indicates 
the following:

<ns1:fault xmlns:ns1="x.y.z">
  <mymessage>You messed up</mymessage>
</ns1:fault>

when I believe that it should indicate the following:

<ns1:fault xmlns:ns1="x.y.z" xsi:type="ns1:MyCustomException">
  <mymessage>You messed up</mymessage>
</ns1:fault>

Note that MyCustomException derives from Exception and it implements 
java.io.Serializable, but is otherwise a standard Java exception class such 
as

public class MyCustomException extends Exception implements 
java.io.Serializable
{
  public String mymessage;
  public MyCustomException()
  {
  }
  public MyCustomException(String mymessage)
  {
    this.mymessage = mymessage;
  }
}

I find it hard to imagine that faults in general do not work or that they do 
not interoperate with gSOAP so I am very open to the possibility that I'm 
simply using them incorrectly.  However, I have yet to find an example of 
how you're supposed to do this correctly that actually works.

Thanks for any help.

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to 
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement