Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 93881 invoked from network); 9 Dec 2004 01:32:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Dec 2004 01:32:37 -0000 Received: (qmail 44684 invoked by uid 500); 9 Dec 2004 01:32:35 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 44647 invoked by uid 500); 9 Dec 2004 01:32:35 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 44633 invoked by uid 99); 9 Dec 2004 01:32:35 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 08 Dec 2004 17:32:34 -0800 Received: (qmail 93836 invoked by uid 65534); 9 Dec 2004 01:32:33 -0000 Date: 9 Dec 2004 01:32:33 -0000 Message-ID: <20041209013233.93831.qmail@minotaur.apache.org> From: hemapani@apache.org To: axis-cvs@ws.apache.org Subject: svn commit: r111334 - in webservices/axis/trunk/java/dev/scratch/prototype2: . src/java/org/apache/axis/client src/java/org/apache/axis/engine src/test/org/apache/axis/engine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: hemapani Date: Wed Dec 8 17:32:33 2004 New Revision: 111334 URL: http://svn.apache.org/viewcvs?view=rev&rev=111334 Log: add a test case to test the gracefull faliure when the error happens at the Engine Modified: webservices/axis/trunk/java/dev/scratch/prototype2/project.xml webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java Modified: webservices/axis/trunk/java/dev/scratch/prototype2/project.xml Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/project.xml?view=diff&rev=111334&p1=webservices/axis/trunk/java/dev/scratch/prototype2/project.xml&r1=111333&p2=webservices/axis/trunk/java/dev/scratch/prototype2/project.xml&r2=111334 ============================================================================== --- webservices/axis/trunk/java/dev/scratch/prototype2/project.xml (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/project.xml Wed Dec 8 17:32:33 2004 @@ -82,7 +82,7 @@ **/*Abstract*.java **/*Util*.java **/*BadInputTest.java - **/*CallUnregisterdServiceTest.java + **/*Test.java Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java?view=diff&rev=111334&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java&r1=111333&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java&r2=111334 ============================================================================== --- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java Wed Dec 8 17:32:33 2004 @@ -36,9 +36,11 @@ import org.apache.axis.impl.llom.builder.StAXBuilder; import org.apache.axis.impl.llom.builder.StAXSOAPModelBuilder; import org.apache.axis.impl.registry.EngineRegistryImpl; +import org.apache.axis.om.OMConstants; import org.apache.axis.om.OMElement; import org.apache.axis.om.OMException; import org.apache.axis.om.OMFactory; +import org.apache.axis.om.OMNamespace; import org.apache.axis.om.OMNode; import org.apache.axis.om.SOAPBody; import org.apache.axis.om.SOAPEnvelope; @@ -93,8 +95,12 @@ while(children != null && children.hasNext() ){ OMNode child = (OMNode)children.next(); if(child.getType() == OMNode.ELEMENT_NODE){ - if(child instanceof SOAPFault){ - throw AxisFault.makeFault(((SOAPFault)child).getException()); + OMElement element = (OMElement)child; + OMNamespace ns = element.getNamespace(); + if(OMConstants.SOAPFAULT_LOCAL_NAME.equals(element.getLocalName()) + && OMConstants.SOAPFAULT_NAMESPACE_URI.equals(ns.getValue())){ + //TODO handle this better + throw new AxisFault(element.getValue()); } return (OMElement)child; } Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java?view=diff&rev=111334&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java&r1=111333&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java&r2=111334 ============================================================================== --- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java Wed Dec 8 17:32:33 2004 @@ -20,6 +20,8 @@ import org.apache.axis.context.MessageContext; import org.apache.axis.impl.handlers.OpNameFinder; +import org.apache.axis.om.OMFactory; +import org.apache.axis.om.SOAPEnvelope; import org.apache.axis.registry.EngineRegistry; import org.apache.axis.registry.Service; import org.apache.commons.logging.Log; @@ -60,12 +62,12 @@ public void recive(MessageContext mc)throws AxisFault{ Service service = null; - if(mc.isServerSide()){ - service = ServiceLocator.locateService(mc); - mc.setService(service); - } - try{ + if(mc.isServerSide()){ + service = ServiceLocator.locateService(mc); + mc.setService(service); + } + if(service != null){ ExecutionChain exeChain = service.getInputExecutionChain(); exeChain.invoke(mc); @@ -94,9 +96,14 @@ }else{ log.debug("recive failed",e); mc.setProcessingFault(true); - ExecutionChain faultExeChain = service.getFaultExecutionChain(); - faultExeChain.invoke(mc); - mc.getEnvelope().getBody().addFault(e); + if(service != null){ + ExecutionChain faultExeChain = service.getFaultExecutionChain(); + faultExeChain.invoke(mc); + } + SOAPEnvelope envelope = OMFactory.newInstance().getDefaultEnvelope(); + //TODO do we need to set old Headers back? + envelope.getBody().addFault(e); + mc.setEnvelope(envelope); sendTheMessage(mc); } } Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java?view=diff&rev=111334&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java&r1=111333&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java&r2=111334 ============================================================================== --- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java Wed Dec 8 17:32:33 2004 @@ -123,7 +123,6 @@ OMElement omele = call.syncCall(method,url); assertNotNull(omele); }catch(AxisFault e){ - //e.printStackTrace(); tearDown(); return; }