Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 21549 invoked from network); 27 Jul 2005 12:02:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Jul 2005 12:02:28 -0000 Received: (qmail 2463 invoked by uid 500); 27 Jul 2005 12:02:24 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 2382 invoked by uid 500); 27 Jul 2005 12:02:24 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 2333 invoked by uid 99); 27 Jul 2005 12:02:23 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 27 Jul 2005 05:02:12 -0700 Received: (qmail 21451 invoked by uid 65534); 27 Jul 2005 12:02:10 -0000 Message-ID: <20050727120210.21450.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r225494 - in /webservices/axis/trunk/java/modules: core/src/org/apache/axis2/clientapi/InOutMEPClient.java xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultImpl.java Date: Wed, 27 Jul 2005 12:02:09 -0000 To: axis-cvs@ws.apache.org From: hemapani@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: hemapani Date: Wed Jul 27 05:01:55 2005 New Revision: 225494 URL: http://svn.apache.org/viewcvs?rev=225494&view=rev Log: fix the http://issues.apache.org/jira/browse/AXIS2-98 Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultImpl.java Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java?rev=225494&r1=225493&r2=225494&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java (original) +++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java Wed Jul 27 05:01:55 2005 @@ -17,13 +17,10 @@ */ package org.apache.axis2.clientapi; -import java.io.IOException; -import java.util.Iterator; - import javax.xml.namespace.QName; -import org.apache.axis2.Constants; import org.apache.axis2.AxisFault; +import org.apache.axis2.Constants; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.context.ConfigurationContext; import org.apache.axis2.context.MessageContext; @@ -35,12 +32,9 @@ import org.apache.axis2.engine.AxisConfiguration; import org.apache.axis2.engine.AxisEngine; import org.apache.axis2.i18n.Messages; -import org.apache.axis2.om.OMElement; import org.apache.axis2.om.OMException; import org.apache.axis2.soap.SOAPEnvelope; import org.apache.axis2.soap.SOAPFault; -import org.apache.axis2.soap.SOAPFaultDetail; -import org.apache.axis2.soap.impl.llom.SOAPConstants; import org.apache.axis2.transport.TransportListener; import org.apache.axis2.util.threadpool.AxisWorker; import org.apache.wsdl.WSDLConstants; @@ -188,20 +182,14 @@ SOAPEnvelope resenvelope = response.getEnvelope(); if (resenvelope.getBody().hasFault()) { SOAPFault soapFault = resenvelope.getBody().getFault(); - SOAPFaultDetail faultDetail = soapFault.getDetail(); - //if there is exception throw it - if(faultDetail != null){ - Iterator it = faultDetail.getAllDetailEntries(); - while(it.hasNext()){ - OMElement detailElement = (OMElement)it.next(); - if(SOAPConstants.SOAP_FAULT_DETAIL_EXCEPTION_ENTRY.equals(detailElement.getLocalName())){ - throw new AxisFault(soapFault.getException()); - } - } + Exception ex = soapFault.getException(); + //does the SOAPFault has a detail element for Excpetion + if(ex != null){ + throw new AxisFault(ex); + }else{ + //if detail element not present let us throw the exception with Reason + throw new AxisFault(soapFault.getReason().getText()); } - //throw new exception with reason - throw new AxisFault(soapFault.getReason().getText()); - } return response; } Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultImpl.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultImpl.java?rev=225494&r1=225493&r2=225494&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultImpl.java (original) +++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultImpl.java Wed Jul 27 05:01:55 2005 @@ -117,14 +117,13 @@ SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME); } - - // ---------------------------------------------------------------------------------------------// - + /** + * If exception detailElement is not there we will return null + */ public Exception getException() throws OMException { - getDetail(); - if (getDetail() == null) { - return new Exception( - "No Exception element found in the SOAP Detail element"); + SOAPFaultDetail detail = getDetail(); + if (detail == null) { + return null; } OMElement exceptionElement = getDetail().getFirstChildWithName( @@ -132,8 +131,7 @@ if (exceptionElement != null) { return new Exception(exceptionElement.getText()); } - return new Exception( - "No Exception element found in the SOAP Detail element"); + return null; } protected void putExceptionToSOAPFault(Exception e) throws SOAPProcessingException {