cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r694468 - in /cxf/branches/2.1.x-fixes: ./ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
Date Thu, 11 Sep 2008 20:45:46 GMT
Author: dkulp
Date: Thu Sep 11 13:45:45 2008
New Revision: 694468

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

........
  r694179 | seanoc | 2008-09-11 04:49:23 -0400 (Thu, 11 Sep 2008) | 1 line
  
  Replaced NodeList
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
    cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 11 13:45:45 2008
@@ -1 +1 @@
-/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653,693819
+/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653,693819,694179

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

Modified: cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java?rev=694468&r1=694467&r2=694468&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
Thu Sep 11 13:45:45 2008
@@ -38,7 +38,6 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.binding.soap.Soap11;
@@ -51,6 +50,7 @@
 import org.apache.cxf.headers.Header;
 import org.apache.cxf.headers.HeaderManager;
 import org.apache.cxf.headers.HeaderProcessor;
+import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.phase.Phase;
@@ -129,47 +129,44 @@
         if (header == null) {
             return;
         }
-        NodeList headerEls = header.getChildNodes();
-        int len = headerEls.getLength();
-        for (int i = 0; i < len; i++) {
-            Node nd = headerEls.item(i);
-            if (Node.ELEMENT_NODE == nd.getNodeType()) {
-                Element hel = (Element)nd;
-                Bus b = message.getExchange().get(Bus.class);
-                HeaderProcessor p =  null;
-                if (b != null && b.getExtension(HeaderManager.class) != null) {
-                    p = b.getExtension(HeaderManager.class).getHeaderProcessor(hel.getNamespaceURI());
-                }
+        Element elem = DOMUtils.getFirstElement(header);
+        while (elem != null) {
+            Bus b = message.getExchange().get(Bus.class);
+            HeaderProcessor p =  null;
+            if (b != null && b.getExtension(HeaderManager.class) != null) {
+                p = b.getExtension(HeaderManager.class).getHeaderProcessor(elem.getNamespaceURI());
+            }
                 
-                Object obj;
-                DataBinding dataBinding = null;
-                if (p == null || p.getDataBinding() == null) {
-                    obj = nd;
-                } else {
-                    obj = p.getDataBinding().createReader(Node.class).read(nd);
-                }
-                //TODO - add the interceptors
+            Object obj;
+            DataBinding dataBinding = null;
+            if (p == null || p.getDataBinding() == null) {
+                obj = elem;
+            } else {
+                obj = p.getDataBinding().createReader(Node.class).read(elem);
+            }
+            //TODO - add the interceptors
                 
-                SoapHeader shead = new SoapHeader(new QName(nd.getNamespaceURI(),
-                        nd.getLocalName()),
-                                                   obj,
-                                                   dataBinding);
-                shead.setDirection(SoapHeader.Direction.DIRECTION_IN);
+            SoapHeader shead = new SoapHeader(new QName(elem.getNamespaceURI(),
+                                                        elem.getLocalName()),
+                                               obj,
+                                               dataBinding);
+            shead.setDirection(SoapHeader.Direction.DIRECTION_IN);
                 
-                String mu = hel.getAttributeNS(message.getVersion().getNamespace(),
-                        message.getVersion().getAttrNameMustUnderstand());
-                String act = hel.getAttributeNS(message.getVersion().getNamespace(),
-                        message.getVersion().getAttrNameRole());
+            String mu = elem.getAttributeNS(message.getVersion().getNamespace(),
+                    message.getVersion().getAttrNameMustUnderstand());
+            String act = elem.getAttributeNS(message.getVersion().getNamespace(),
+                    message.getVersion().getAttrNameRole());
                 
-                shead.setActor(act);
-                shead.setMustUnderstand(Boolean.valueOf(mu) || "1".equals(mu));
-                Header oldHdr = message.getHeader(
-                        new QName(nd.getNamespaceURI(), nd.getLocalName()));
-                if (oldHdr != null) {
-                    message.getHeaders().remove(oldHdr);
-                } 
-                message.getHeaders().add(shead);                        
-            }
+            shead.setActor(act);
+            shead.setMustUnderstand(Boolean.valueOf(mu) || "1".equals(mu));
+            Header oldHdr = message.getHeader(
+                    new QName(elem.getNamespaceURI(), elem.getLocalName()));
+            if (oldHdr != null) {
+                message.getHeaders().remove(oldHdr);
+            } 
+            message.getHeaders().add(shead);                        
+            
+            elem = DOMUtils.getNextElement(elem);
         }
     }
 

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java?rev=694468&r1=694467&r2=694468&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
Thu Sep 11 13:45:45 2008
@@ -58,6 +58,7 @@
 import org.apache.cxf.binding.soap.SoapVersion;
 import org.apache.cxf.binding.soap.SoapVersionFactory;
 import org.apache.cxf.headers.Header;
+import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.InterceptorChain;
 import org.apache.cxf.io.CachedOutputStream;
@@ -246,10 +247,9 @@
         control.verify();
 
         // Verify SOAPMessage header
-        SOAPMessage soapMessageNew = message.getContent(SOAPMessage.class);
-        NodeList headerEls = soapMessageNew.getSOAPHeader().getChildNodes();
+        SOAPMessage soapMessageNew = message.getContent(SOAPMessage.class);       
 
-        Element headerElementNew = (Element)headerEls.item(0);
+        Element headerElementNew = DOMUtils.getFirstElement(soapMessageNew.getSOAPHeader());
         
         SoapVersion soapVersion = Soap11.getInstance();
         assertEquals("false", headerElementNew.getAttributeNS(soapVersion.getNamespace(),
"mustUnderstand"));



Mime
View raw message