axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r556750 - in /webservices/axis2/trunk/java/modules: jaxws/src/org/apache/axis2/jaxws/core/ jaxws/src/org/apache/axis2/jaxws/server/ jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ kernel/src/org/apache/axis2/
Date Mon, 16 Jul 2007 22:13:18 GMT
Author: scheu
Date: Mon Jul 16 15:13:16 2007
New Revision: 556750

URL: http://svn.apache.org/viewvc?view=rev&rev=556750
Log:
AXIS2-2975
Contributor:Roy Wood
Minor addition to AxisFault to allow an AxisFault to be created with both a MessageContext
and a throwable cause.
Small change to the jaxws module to use the api.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/MessageContext.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/AxisFault.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/MessageContext.java?view=diff&rev=556750&r1=556749&r2=556750
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/MessageContext.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/MessageContext.java
Mon Jul 16 15:13:16 2007
@@ -18,6 +18,7 @@
  */
 package org.apache.axis2.jaxws.core;
 
+import org.apache.axis2.AxisFault;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.jaxws.description.EndpointDescription;
 import org.apache.axis2.jaxws.description.OperationDescription;
@@ -73,6 +74,7 @@
     // If a local exception is thrown, the exception is placed on the message context.
     // It is not converted into a Message.
     private Throwable localException = null;
+    private AxisFault causedByException = null;
 
     /**
      * Construct a MessageContext without a prior Axis2 MessageContext
@@ -252,6 +254,21 @@
         localException = t;
     }
     
+    /**
+     * @param t
+     */
+    public void setCausedByException (AxisFault t){
+        this.causedByException = t;
+    }
+    
+    /**
+     * @return
+     */
+    public AxisFault getCausedByException(){
+        return this.causedByException;
+    }
+    
+
     /**
      * Set the wrapper MEPContext.  Internally, this method also sets
      * the MEPContext's children so the pointer is bi-directional; you can

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java?view=diff&rev=556750&r1=556749&r2=556750
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java
Mon Jul 16 15:13:16 2007
@@ -126,9 +126,17 @@
                 // If this is a fault message, we want to throw it as an
                 // exception so that the transport can do the appropriate things
                 if (responseMsgCtx.getMessage().isFault()) {
-                    faultToReturn = new AxisFault("An error was detected during JAXWS processing",
-                                                  axisResponseMsgCtx);
-                } else {
+                    
+                    //Rather than create a new AxisFault, we should use the AxisFault that
was
+                    //created at the causedBy
+                    if (responseMsgCtx.getCausedByException() != null)
+                        faultToReturn = responseMsgCtx.getCausedByException();
+                    else {
+                        faultToReturn = new AxisFault("An error was detected during JAXWS
processing",
+                                                                                 axisResponseMsgCtx);
+                        
+                    }
+                                    } else {
                     //This assumes that we are on the ultimate execution thread
                     ThreadContextMigratorUtil.performMigrationToContext(
                             Constants.THREAD_CONTEXT_MIGRATOR_LIST_ID, axisResponseMsgCtx);

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java?view=diff&rev=556750&r1=556749&r2=556750
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
Mon Jul 16 15:13:16 2007
@@ -34,6 +34,7 @@
 import org.apache.commons.logging.LogFactory;
 
 import javax.xml.ws.soap.SOAPBinding;
+import org.apache.axis2.AxisFault;
 import java.lang.reflect.Method;
 
 /**
@@ -126,6 +127,14 @@
         if (faultThrown) {
             responseMsgCtx = MessageContextUtils.createFaultMessageContext(mc);
             responseMsgCtx.setMessage(message);
+
+            AxisFault axisFault = new AxisFault("An error was detected during JAXWS processing",
+                                              responseMsgCtx.getAxisMessageContext(),
+                                              fault);
+            
+            responseMsgCtx.setCausedByException(axisFault);
+
+
         } else {
             responseMsgCtx = MessageContextUtils.createResponseMessageContext(mc);
             responseMsgCtx.setMessage(message);

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=556750&r1=556749&r2=556750
==============================================================================
--- 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 Mon Jul
16 15:13:16 2007
@@ -295,6 +295,19 @@
         setFaultCode(faultCode);
     }
 
+    
+    /**
+     * @param message
+     * @param faultMessageContext
+     * @param cause
+     */
+    public AxisFault(String message, MessageContext faultMessageContext, Throwable cause)
{
+        super(message, cause);
+
+        this.faultMessageContext = faultMessageContext;
+    }
+
+
     /**
      * @param messageText - this will appear as the Text in the Reason information item of
SOAP Fault
      * @param faultCode   - this will appear as the Value in the Code information item of
SOAP Fault



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