axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chamik...@apache.org
Subject svn commit: r418442 - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2: engine/AxisEngine.java util/CallbackReceiver.java
Date Sat, 01 Jul 2006 05:34:43 GMT
Author: chamikara
Date: Fri Jun 30 22:34:42 2006
New Revision: 418442

URL: http://svn.apache.org/viewvc?rev=418442&view=rev
Log:
Corrections to the AxisEngine.receiveFault method to call the MessageReceiver (in the client
side this will be the CallbackReceiver) after invocation of the handler chain.

In the CallbackReceiver onError method should be called in case of faults.

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/CallbackReceiver.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java?rev=418442&r1=418441&r2=418442&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
Fri Jun 30 22:34:42 2006
@@ -575,7 +575,8 @@
      * @throws AxisFault
      */
     public void receiveFault(MessageContext msgContext) throws AxisFault {
-        log.info(Messages.getMessage("receivederrormessage",
+
+    	log.info(Messages.getMessage("receivederrormessage",
                 msgContext.getMessageID()));
         ConfigurationContext confContext = msgContext.getConfigurationContext();
         ArrayList preCalculatedPhases =
@@ -586,6 +587,18 @@
         msgContext.setExecutionChain((ArrayList) preCalculatedPhases.clone());
         msgContext.setFLOW(MessageContext.IN_FAULT_FLOW);
         invoke(msgContext);
+        
+        if (msgContext.isServerSide() && !msgContext.isPaused()) {
+
+            // invoke the Message Receivers
+            checkMustUnderstand(msgContext);
+
+            checkUsingAddressing(msgContext);
+
+            MessageReceiver receiver = msgContext.getAxisOperation().getMessageReceiver();
+
+            receiver.receive(msgContext);
+        }
     }
 
     public void resume(MessageContext msgctx) throws AxisFault {
@@ -655,7 +668,14 @@
             AxisOperation axisOperation = opContext.getAxisOperation();
             ArrayList faultExecutionChain = axisOperation.getPhasesOutFaultFlow();
 
-            msgContext.setExecutionChain((ArrayList) faultExecutionChain.clone());
+            //adding both operation specific and global out fault flows.
+            
+            ArrayList outFaultPhases = new ArrayList();
+            outFaultPhases.addAll((ArrayList) faultExecutionChain.clone());
+            outFaultPhases.addAll((ArrayList) msgContext.getConfigurationContext()
+                    .getAxisConfiguration().getOutFaultFlow().clone());
+            
+            msgContext.setExecutionChain((ArrayList) outFaultPhases.clone());
             msgContext.setFLOW(MessageContext.OUT_FAULT_FLOW);
             invoke(msgContext);
         }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/CallbackReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/CallbackReceiver.java?rev=418442&r1=418441&r2=418442&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/CallbackReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/CallbackReceiver.java
Fri Jun 30 22:34:42 2006
@@ -16,6 +16,8 @@
 
 package org.apache.axis2.util;
 
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFault;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.RelatesTo;
 import org.apache.axis2.addressing.AddressingConstants;
@@ -50,7 +52,21 @@
         AsyncResult result = new AsyncResult(messageCtx);
 
         if (callback != null) {
-            callback.onComplete(result);
+        	
+        	//check weather the result is a fault.
+        	SOAPEnvelope envelope = result.getResponseEnvelope();
+        	SOAPFault fault = envelope.getBody().getFault();
+        	
+        	if (fault==null) {
+        		//if there is not fault call the onComplete method
+        		callback.onComplete(result);
+        	} else {
+        		//else call the on error method with the fault
+                AxisFault axisFault = new AxisFault(fault.getCode(), fault.getReason(),
+                		fault.getNode(), fault.getRole(), fault.getDetail());
+
+        		callback.onError(axisFault);
+        	}
             callback.setComplete(true);
         } else {
             throw new AxisFault("The Callback realtes to MessageID " + messageID + " is not
found");



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message