You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2012/09/20 04:10:35 UTC

svn commit: r1387842 - in /cxf/trunk: rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java

Author: ffang
Date: Thu Sep 20 02:10:34 2012
New Revision: 1387842

URL: http://svn.apache.org/viewvc?rev=1387842&view=rev
Log:
[CXF-4511]WS-RM Sequence header should have mustUnderstand attribute

Modified:
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
    cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java?rev=1387842&r1=1387841&r2=1387842&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java Thu Sep 20 02:10:34 2012
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
 import org.apache.cxf.binding.Binding;
 import org.apache.cxf.binding.soap.Soap11;
 import org.apache.cxf.binding.soap.SoapFault;
+import org.apache.cxf.binding.soap.SoapHeader;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
 import org.apache.cxf.common.logging.LogUtils;
@@ -183,7 +184,13 @@ public class RMSoapInterceptor extends A
                 message.put(Message.RESPONSE_CODE, HttpURLConnection.HTTP_OK);
             }
             while (node != null) {
-                Header holder = new Header(new QName(node.getNamespaceURI(), node.getLocalName()), node);
+                Header holder = null;
+                if (node.getLocalName().equals("Sequence")) {
+                    holder = new SoapHeader(new QName(node.getNamespaceURI(), node.getLocalName()), node);
+                    ((SoapHeader)holder).setMustUnderstand(true);
+                } else {
+                    holder = new Header(new QName(node.getNamespaceURI(), node.getLocalName()), node);
+                }
                 headers.add(holder);
                 node = node.getNextSibling();
             }

Modified: cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java?rev=1387842&r1=1387841&r2=1387842&view=diff
==============================================================================
--- cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java (original)
+++ cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java Thu Sep 20 02:10:34 2012
@@ -289,7 +289,10 @@ public class ProtocolVariationsTest exte
             assertTrue(e.getCause() instanceof SoapFault);
             // verify a partial error text match to exclude an unexpected exception
             // (see WSRM_REQUIRED_EXC in Messages.properties)
-            final String text = "WS-ReliableMessaging is required";
+            //because the ws-rm namespace isn't correct, can't detect it's a ws-rm message
+            //so can't understand ws-rm header
+            final String text = "MustUnderstand headers: " 
+                                + "[{http://cxf.apache.org/invalid}Sequence] are not understood.";
             assertTrue(e.getCause().getMessage() != null 
                 && e.getCause().getMessage().indexOf(text) >= 0);
         }