axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r807837 - /webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java
Date Tue, 25 Aug 2009 22:17:16 GMT
Author: scheu
Date: Tue Aug 25 22:17:15 2009
New Revision: 807837

URL: http://svn.apache.org/viewvc?rev=807837&view=rev
Log:
AXIS2-4474
Contributor:Rich Scheuerle
Detect the presence of a SOAP:Fault in the Provider's response.
If detected, a Fault response message context is built (which will respect the settings of
the wsa FaultTo address)

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java?rev=807837&r1=807836&r2=807837&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java
Tue Aug 25 22:17:15 2009
@@ -339,6 +339,14 @@
         return requestParamValue;
     }
     
+    /**
+     * Create a MessageContext for the response. This could be a normal response
+     * or a fault response depending on the characteristics of output
+     * @param request MessageContext
+     * @param input[] input Objects
+     * @param output Object representing output of Provider
+     * @return MessageContext for normal or fault path
+     */
     public MessageContext createResponse(MessageContext request, Object[] input, Object output)
{
         if (log.isDebugEnabled()) {
             log.debug("Start createResponse");
@@ -357,9 +365,6 @@
             throw ExceptionFactory.makeWebServiceException(t);
         }
 
-        if (log.isDebugEnabled()) {
-            log.debug("Response message is created.");
-        }
         
         MessageContext response = null;
         try {
@@ -368,8 +373,17 @@
                 m.setMTOMEnabled(true);
             }
             
-
-            response = MessageContextUtils.createResponseMessageContext(request);
+            if (!m.isFault()) {
+                if (log.isDebugEnabled()) {
+                    log.debug("Non-Fault Response MessageContext is created.");
+                }
+                response = MessageContextUtils.createResponseMessageContext(request);
+            } else {
+                if (log.isDebugEnabled()) {
+                    log.debug("Fault Response MessageContext is created.");
+                }
+                response = MessageContextUtils.createFaultMessageContext(request);
+            }
             initMessageContext(response, m, output);
         } catch (RuntimeException e) {
             if (log.isDebugEnabled()) {



Mime
View raw message