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 "Sapozhnikov, Michael" <ms...@axsone.com> on 2002/08/19 22:29:16 UTC

How to handle faults?

I am trying to make faults work, but have some problems. I don't have any
previous experience with faults.

I am getting SOAPFault from the non-AXIS server, which I want to process in
the client program.

1. When I add fault processing to wsdl resulting generated client code does
not reflect that it extends Exception or AxisFault, so code does not
compile. 

2. Making adjustment to the generated code (extends Exception) still does
not allow to extract fault info from the SOAPFault which has custom fields
under <detail> tag. AxisFault has limited knowledge about original wire SOAP
fault, only node names.

For the resulting AxisFault e in the following code all node names are
correct, but values are null.
	org.w3c.dom.Element[] elem = e.getFaultDetails();
            
            for (int i = 0; i < java.lang.reflect.Array.getLength(elem);
i++){
                System.out.println("name=" + elem[i].getNodeName() + 
                "  value=" + elem[i].getNodeValue());
            }
Are these values stored somewhere? Could they be extracted and how?

Looks like AXIS does not deserealize values, just extracts AxisFault from
the SOAPFault. Could deserealization be added for the faults?

Are these bugs or just something that should be handled differently?

Any help is greatly appreciated.

I am using AXIS nightly build as of 7/29. 

Thanks,

Michael Sapozhnikov