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 Tom Jordahl <to...@macromedia.com> on 2002/10/14 18:18:39 UTC

RE: custom faults

Just FYI for those who are interested in this functionality.

Recent nightly builds (post 1.0) have support for custom fault data.  It is still pretty fresh, so bug reports are welcome.

The SOAP Builders interop event was held last week in Burlington, MA and Apache Axis successfully completed interop in Group H (faults with data) with Sun & White Mesa (rpc/encoded) and .NET (document/literal).

--
Tom Jordahl
Macromedia Server Development



-----Original Message-----
From: Tom Jordahl [mailto:tomj@macromedia.com]
Sent: Friday, September 06, 2002 10:09 AM
To: 'axis-user@xml.apache.org'
Cc: 'axis-dev@xml.apache.org'
Subject: RE: custom faults



> Will serialization of fault data be supported in Release 1?  
> Haven't seen any references to this in the RC1 release notes.

Unless someone drops an implementation on our heads early next week, no, Axis wont serialize fault data for 1.0.

I will say that the next soap builders interop event is coming up in October and one of the test groups is faults (with data):
  http://soapinterop.java.sun.com/soapbuilders/r4/index.html

This is incentive for that work to get done by one of the committers. :-)

Here is some design on the fly:
We need to figure out how other (the JAX-RPC RI for instance) relates the element in the <details> to an exception class on the client.  Axis put the class name in a details element, but that is just plain wrong (I did that ;-).

Here is how I think we can do that:

We will need some meta-data in the runtime that keeps a list of fault part QNames and their corresponding classes.  WSDL2Java would have to generate this.  WSDL limits faults to a single message part, so the table lookup should be unique.  We can then search each element in details, looking up the QNames of each to see if we get a match in the table, if we do, we take that element and run it through the deserialization system  to fill in the data in an object of the class we found in the table. I think this is a tricky part getting the fault processor and the deserialization subsystem hooked together.  I may be making a mountain out of a mole hill.

If we can't find anything in the meta data, we just return the SOAPFault (aka AxisFault).

Thoughts (and implementation code!) would be very much appreciated!

--
Tom Jordahl
Macromedia Server Development



-----Original Message-----
From: Agrawal, Anuj (Anuj)** CTR ** [mailto:agrawal@lucent.com]
Sent: Friday, September 06, 2002 9:01 AM
To: 'axis-user@xml.apache.org'
Subject: RE: custom faults


Tom -

Will serialization of fault data be supported in Release 1?  Haven't seen any references to this in the RC1 release notes.

Thanks.
Anuj.

> -----Original Message-----
> From: Tom Jordahl [mailto:tomj@macromedia.com]
> Sent: Tuesday, August 27, 2002 10:23 AM
> To: 'axis-user@xml.apache.org'; 'axis-dev@xml.apache.org'
> Subject: RE: custom faults
> 
> Serialization of fault data is not currently implemented in Axis.
> 
> As to when it will be done, the standard Open Source answer is:
>  "Sooner, if you help."
> 
> This has been on my (and others) TODO list for a while, we 
> just haven't gotten it done.
> 
> --
> Tom Jordahl
> Macromedia Server Development
> 
> -----Original Message-----
> From: Geza.Szocs@nokia.com [mailto:Geza.Szocs@nokia.com]
> Sent: Tuesday, August 27, 2002 4:33 AM
> To: axis-user@xml.apache.org; axis-dev@xml.apache.org
> Subject: custom faults
> 
> 
> Hi,
> 
>  As far as I know the final mechanism to handle custom
> SOAP faults is missing in Axis. Although, looking at the source
> code, it looks like the problem is moving towards a solution.
> Is somebody working on this issue ? Can you developers tell us
> a probable date when this will be ready ? 
>  The thing is, that I need to solve this problem ASAP, meaning
> in the next days. Concluding the previous experiences, the thing
> seems to work if one can somehow put it's custom data into the
> AxisFault's faultDetail field. So what we have right now is a custom
> exception class dervied from AxisFault and generated from a WSDL.
> What we (I) need is way to serialize my custom data from the exception
> and insert it into the detail field of the AxisFault object. Looking
> at the source of the generated exceptions, it seems that 
> there are things
> (like TypeDesc, etc) that help the serialization of these exceptions.
> This could be made by an exception-serializer handler or 
> something like
> that. 
>   What do you guys thing is the solution to do this ? Or is this
> done yet in the latest nightly ? If not please suggest me a starting
> direction. I assume that a BeanSerializer should digest these 
> exceptions
> somehow. How to do it ?
>   
>   Thanx for help, Geza
> 
> P.S. Please respond to the axis-user list. 
>