cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1178546 - /cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java
Date Mon, 03 Oct 2011 19:55:05 GMT
Author: dkulp
Date: Mon Oct  3 19:55:05 2011
New Revision: 1178546

URL: http://svn.apache.org/viewvc?rev=1178546&view=rev
Log:
[CXF-3813] Remove the soap specific attributes before unmarshalling the
header to prevent validation errors.

Modified:
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java?rev=1178546&r1=1178545&r2=1178546&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java
Mon Oct  3 19:55:05 2011
@@ -28,6 +28,7 @@ import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
 import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.binding.soap.SoapVersion;
 import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
 import org.apache.cxf.headers.Header;
 import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
@@ -57,6 +58,7 @@ public class SoapHeaderInterceptor exten
 
     public void handleMessage(Message m) throws Fault {
         SoapMessage message = (SoapMessage) m;
+        SoapVersion soapVersion = message.getVersion();
         Exchange exchange = message.getExchange();
 
         MessageContentsList parameters = MessageContentsList.getContentsList(message);
@@ -99,6 +101,16 @@ public class SoapHeaderInterceptor exten
                     
                     if (param.getDataBinding() == null) {
                         Node source = (Node)param.getObject();
+                        if (source instanceof Element) {
+                            //need to remove these attributes as they
+                            //would cause validation failures
+                            Element el = (Element)source;
+                            
+                            el.removeAttributeNS(soapVersion.getNamespace(),
+                                              soapVersion.getAttrNameMustUnderstand());
+                            el.removeAttributeNS(soapVersion.getNamespace(),
+                                               soapVersion.getAttrNameRole());
+                        }
                         if (supportsNode) {
                             object = getNodeDataReader(message).read(mpi, source);
                         } else {



Mime
View raw message