axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davidills...@apache.org
Subject svn commit: r517730 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: AxisFault.java util/MessageContextBuilder.java
Date Tue, 13 Mar 2007 15:27:52 GMT
Author: davidillsley
Date: Tue Mar 13 08:27:51 2007
New Revision: 517730

URL: http://svn.apache.org/viewvc?view=rev&rev=517730
Log:
Fix for AXIS2-2291
Added get/setFaultAction methods
Made AxisFault actually serializable simple by making the
inner class implement the interface.

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/AxisFault.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/AxisFault.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/AxisFault.java?view=diff&rev=517730&r1=517729&r2=517730
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/AxisFault.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/AxisFault.java Tue Mar
13 08:27:51 2007
@@ -30,6 +30,8 @@
 import org.apache.axis2.context.MessageContext;
 
 import javax.xml.namespace.QName;
+
+import java.io.Serializable;
 import java.lang.reflect.InvocationTargetException;
 import java.rmi.RemoteException;
 import java.util.ArrayList;
@@ -107,6 +109,8 @@
      */
     private String nodeURI;
 
+	private String faultAction;
+
 
     /**
      * @param message
@@ -508,7 +512,7 @@
         return faultMessageContext;
     }
 
-    class FaultReason {
+    class FaultReason implements Serializable{
 
         /**
          * Language of the reason.
@@ -554,5 +558,19 @@
             this.text = text;
         }
     }
-
+    
+    /**
+     * @return the action value set for the fault message  
+     */
+	public String getFaultAction() {
+		return faultAction;
+	}
+
+	/**
+	 * Set the (OPTIONAL) action value for the fault message 
+	 * @param faultAction
+	 */
+	public void setFaultAction(String faultAction) {
+		this.faultAction = faultAction;
+	}
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java?view=diff&rev=517730&r1=517729&r2=517730
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java
Tue Mar 13 08:27:51 2007
@@ -244,12 +244,19 @@
         faultContext.setProcessingFault(true);
 
         // Set wsa:Action for response message
+        
         // Use specified value if available
         AxisOperation op = processingContext.getAxisOperation();
         if (op != null && op.getFaultAction() != null) {
             faultContext.setWSAAction(op.getFaultAction());
         } else { //If, for some reason there is no value set, should use a sensible action.
             faultContext.setWSAAction(Final.WSA_SOAP_FAULT_ACTION);
+        }
+        // override if the fault action has been set in the AxisFault
+        if (e instanceof AxisFault) {
+        	if(((AxisFault)e).getFaultAction() != null){
+        		faultContext.setWSAAction(((AxisFault)e).getFaultAction());
+        	}
         }
 
         // there are some information  that the fault thrower wants to pass to the fault
path.



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