axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@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
Date Thu, 09 Dec 2004 01:32:33 GMT
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 @@
         <exclude>**/*Abstract*.java</exclude>
 	    <exclude>**/*Util*.java</exclude>
         <exclude>**/*BadInputTest.java</exclude>
-        <exclude>**/*CallUnregisterdServiceTest.java</exclude>
+       <!-- <exclude>**/*CallUnregisterdServiceTest.java</exclude> -->
       </excludes>
       <includes>
         <include>**/*Test.java</include>

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;
         }

Mime
View raw message