cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1060059 - in /cxf/trunk: api/src/main/java/org/apache/cxf/phase/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ systests/ws-specs/src/test/resources/wsdl_systest_wsspec/
Date Mon, 17 Jan 2011 19:52:46 GMT
Author: dkulp
Date: Mon Jan 17 19:52:45 2011
New Revision: 1060059

URL: http://svn.apache.org/viewvc?rev=1060059&view=rev
Log:
[CXF-3188] Make sure the mustUnderstand fault is sent back
to the client even if there is a problem in the body.

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
    cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/DoubleIt.wsdl

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?rev=1060059&r1=1060058&r2=1060059&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java Mon Jan 17
19:52:45 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/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java?rev=1060059&r1=1060058&r2=1060059&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
Mon Jan 17 19:52:45 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/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/DoubleIt.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/DoubleIt.wsdl?rev=1060059&r1=1060058&r2=1060059&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/DoubleIt.wsdl (original)
+++ cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/DoubleIt.wsdl Mon Jan
17 19:52:45 2011
@@ -500,7 +500,7 @@
 						</sp:AlgorithmSuite>
 						<sp:Layout>
 							<wsp:Policy>
-								<sp:Lax />XPath
+								<sp:Lax />
 							</wsp:Policy>
 						</sp:Layout>
 						<sp:IncludeTimestamp />



Mime
View raw message