You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Eran Chinthaka <ch...@opensource.lk> on 2007/02/04 03:43:11 UTC

Re: [axis2] AxisFault behavior clarification

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nicholas L Gallardo wrote:
> 
> There seems to be some ambiguous behavior, to me at least, in the
> AxisFault  that I was hoping someone could clarify.  Specifically, the
> following comment threw me off:
> 
>     /**
>      * This is just a convenience method for the user. If you set these,
> do not use other methods
>      * in this class to get and set things.
>      * Any of the parameters can be null
>      *
>      * @param soapFaultCode
>      * @param soapFaultReason
>      * @param soapFaultNode
>      * @param soapFaultRole
>      */
>     public AxisFault(SOAPFaultCode soapFaultCode, SOAPFaultReason
> soapFaultReason,
>                      SOAPFaultNode soapFaultNode, SOAPFaultRole
> soapFaultRole, SOAPFaultDetail soapFaultDetail)  {
> 
> 
> The comment indicates that when you create an AxisFault with this
> constructor, the expected behavior is somewhat different from what the
> available APIs (getters for faultCode, detail, etc.)  would make you
> believe.  So, if this constructor is used, what IS a valid expectation
> of the AxisFault as far as methods that can be used to get at data?  Or
> is this comment just stale?

I put this comment some time back to alert user if he is trying to
inject some more information in to AxisFault using other setter methods.

Internally, as you might have already seen, what I was doing is that, if
the above params are set, I just populate the SOAPFault with them rather
than trying to figure out the values from other means.

> 
> Beyond that, there seem to be two different styles of data contained
> within the AxisFault.  In most cases, there object just contains data
> members that represent different parts of a SOAP fault.  All of the
> constructors with the exception of the one listed above seem to create
> an AxisFault that operates like this.  The second style of data that I'm
> seeing is XML data from a SOAP fault itself.  When the above constructor
> is called, each of those elements is saved off in a HashMap such that
> they can be queried later on, with a different set of getter methods
> from the ones used for all of the other AxisFault modes.
> 
> So it seems like the AxisFault is trying to be an amalgam of both the
> XML representation of a fault and the data representation (the specific
> values for key pieces of fault information absent the XML).  

Yes you are correct in that. AxisFault is used everywhere and some users
like to call throw new AxisFault(String code, String reason, ..) and
expect to see all the proper things to appear in the SOAPFault message.
At the same time, some users need the total control of what the engine
sends as the SOAPFault.


> 
> Am I understanding this correctly, or am I missing something?  

Yes what u've understood is correct.

- -- Chinthaka
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFxUg+jON2uBzUhh8RAlFwAJ9HPVD5a0SOnleM4a3UZuPFUn1pWQCghoMx
OcwJu4GbFm2SbNu33uv9DDw=
=Uy3D
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org