public class FaultDetail {
java.lang.String errorMessage; java.lang.String requestID; ... } |
try
{ // code to Access the Web Service } catch (AxisFault e) { // Get the (single) child element of the SOAP Fault <detail> element, // the <FaultDetail> element. Element[] faultDetails = e.getFaultDetails( ); if (faultDetails.length > 0) { // Now get the contents of the <FaultDetail> element, // <errorMessage> and <requestID>. Node faultDetailElem = faultDetails[0].getFirstChild( ); String detailErrorMsg = faultDetailElem.getFirstChild( ).getNodeValue( ); System.err.println("Exception errorMessage: " + detailErrorMsg); Node requestIDElem = faultDetailElem.getNextSibling( ); String requestID = requestIDElem.getFirstChild( ).getNodeValue( ); System.err.println("Exception requestID : " + requestID); } } |