Author: dkulp
Date: Mon Jan 17 20:01:18 2011
New Revision: 1060066

URL: http://svn.apache.org/viewvc?rev=1060066&view=rev
Log:
Merged revisions 1060059 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1060059 | dkulp | 2011-01-17 14:52:45 -0500 (Mon, 17 Jan 2011) | 2 lines
  
  [CXF-3188] Make sure the mustUnderstand fault is sent back
  to the client even if there is a problem in the body.
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    
cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
    
cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
    
cxf/branches/2.3.x-fixes/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/DoubleIt.wsdl

Propchange: cxf/branches/2.3.x-fixes/
            ('svn:mergeinfo' removed)

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?rev=1060066&r1=1060065&r2=1060066&view=diff
==============================================================================
--- 
cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
 (original)
+++ 
cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
 Mon Jan 17 20:01:18 2011
@@ -285,25 +285,29 @@ public class PhaseInterceptorChain imple
                                 description.append("\' ");
                             }
                         }
+                        
+                        message.setContent(Exception.class, ex);
+                        unwind(message);
+                        Exception ex2 = message.getContent(Exception.class);
+                        if (ex2 == null) {
+                            ex2 = ex;
+                        }
 
                         FaultListener flogger = (FaultListener)
                                 
message.getContextualProperty(FaultListener.class.getName());
                         boolean useDefaultLogging = true;
                         if (flogger != null) {
-                            useDefaultLogging = flogger.faultOccurred(ex, 
description.toString(), message);
+                            useDefaultLogging = flogger.faultOccurred(ex2, 
description.toString(), message);
                         }
                         if (useDefaultLogging) {
-                            doDefaultLogging(message, ex, description);
+                            doDefaultLogging(message, ex2, description);
                         }
 
     
-                        message.setContent(Exception.class, ex);
-                                            
-                        unwind(message);
                         
                         boolean isOneWay = false;
                         if (message.getExchange() != null) {
-                            message.getExchange().put(Exception.class, ex);
+                            message.getExchange().put(Exception.class, ex2);
                             isOneWay = message.getExchange().isOneWay();
                         }
                         
@@ -324,7 +328,7 @@ public class PhaseInterceptorChain imple
         }
     }
 
-    private void doDefaultLogging(Message message, RuntimeException ex, 
StringBuilder description) {
+    private void doDefaultLogging(Message message, Exception ex, StringBuilder 
description) {
         FaultMode mode = message.get(FaultMode.class);
         if (mode == FaultMode.CHECKED_APPLICATION_FAULT) {
             if (isFineLogging) {

Modified: 
cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java?rev=1060066&r1=1060065&r2=1060066&view=diff
==============================================================================
--- 
cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
 (original)
+++ 
cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
 Mon Jan 17 20:01:18 2011
@@ -96,6 +96,16 @@ public class MustUnderstandInterceptor e
             checkUltimateReceiverHeaders(ultimateReceiverHeaders, 
mustUnderstandQNames, soapMessage);
         }
     }
+    public void handleFault(SoapMessage message) {
+        SoapFault soapFault = 
(SoapFault)message.get(MustUnderstandInterceptor.FAULT);
+        if (soapFault != null
+            && !message.getExchange().isOneWay()
+            && soapFault != message.getContent(Exception.class)) {
+            
+            message.setContent(Exception.class, soapFault);
+        }
+    }
+
 
     private void checkUltimateReceiverHeaders(Set<Header> 
ultimateReceiverHeaders,
                                               Set<QName> mustUnderstandQNames, 

Modified: 
cxf/branches/2.3.x-fixes/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/DoubleIt.wsdl
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/DoubleIt.wsdl?rev=1060066&r1=1060065&r2=1060066&view=diff
==============================================================================
--- 
cxf/branches/2.3.x-fixes/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/DoubleIt.wsdl
 (original)
+++ 
cxf/branches/2.3.x-fixes/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/DoubleIt.wsdl
 Mon Jan 17 20:01:18 2011
@@ -500,7 +500,7 @@
                                                </sp:AlgorithmSuite>
                                                <sp:Layout>
                                                        <wsp:Policy>
-                                                               <sp:Lax />XPath
+                                                               <sp:Lax />
                                                        </wsp:Policy>
                                                </sp:Layout>
                                                <sp:IncludeTimestamp />


Reply via email to