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:20:59 UTC

svn commit: r1387843 - in /cxf/branches/2.6.x-fixes: ./ 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:20:59 2012
New Revision: 1387843

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

........
  r1387842 | ffang | 2012-09-20 10:10:34 +0800 (四, 20  9 2012) | 1 line
  
  [CXF-4511]WS-RM Sequence header should have mustUnderstand attribute
........

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
    cxf/branches/2.6.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1387842

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

Modified: cxf/branches/2.6.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java?rev=1387843&r1=1387842&r2=1387843&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java (original)
+++ cxf/branches/2.6.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java Thu Sep 20 02:20:59 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/branches/2.6.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java?rev=1387843&r1=1387842&r2=1387843&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java (original)
+++ cxf/branches/2.6.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java Thu Sep 20 02:20:59 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);
         }