You can easily set all attributes of the thrown soap fault.  
Have a look at the code below.  In your service implementation you can do:

  AxisFault af = new AxisFault();

  af.setFaultActor("Sylvain");
  af.setFaultCode("This is a faultCode");
  af.setFaultDetailString("This is a fault detailString");
  af.setFaultString("This is a fault string");

  try { 
    af.setFaultDetail( 
      new Element[] {
        stringToDocument("<crap></crap>").getDocumentElement()});

  } catch ( Exception e ) {
     throw new  java.rmi.RemoteException();
  }

  throw af;


What is missing in Axis is the hability to have Axis throwing your own type
instead of AxisFault.  Which should utlimately be derived from the WSDL. 

Good luck,
Sylvain.


-----Original Message-----
From: Arne M. Degenring [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 10, 2002 1:17 PM
To: [EMAIL PROTECTED]
Subject: RE: support for user defined exceptions


> -----Original Message-----
> From: Agrawal, Anuj (Anuj)** CTR ** [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, July 10, 2002 6:08 PM
> To: 'Axis User Mailing List'
> Subject: support for user defined exceptions
> Importance: High
> 
> 
> It appears that when my service throws an exception, that 
> exception is not handled in any fashion by the Axis engine.  
> Is support for user defined exceptions not provided in Axis 
> yet? or ... ?  I haven't seen this reported in the bug list, 
> but i have seen *some* documentation on fault handling in 
> axis but it wasn't very clear (to me).


I'm asking me the same thing. I asked questions regarding custom
exceptions (especially: how can I set my own SOAP fault code?) some days
ago - unfortunately nobody answered.

I really think some clarification would help many Axis users. Perharps
somebody from the Development team, or somebody else who knows it, is
reading this?

Thanks for your help!

Arne


This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

Reply via email to