cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajaypai...@apache.org
Subject svn commit: r537843 - /incubator/cxf/branches/headerwork/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
Date Mon, 14 May 2007 13:51:18 GMT
Author: ajaypaibir
Date: Mon May 14 06:51:17 2007
New Revision: 537843

URL: http://svn.apache.org/viewvc?view=rev&rev=537843
Log:
Applying another patch from ulhas related to header work.

Modified:
    incubator/cxf/branches/headerwork/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java

Modified: incubator/cxf/branches/headerwork/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/headerwork/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java?view=diff&rev=537843&r1=537842&r2=537843
==============================================================================
--- incubator/cxf/branches/headerwork/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
(original)
+++ incubator/cxf/branches/headerwork/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
Mon May 14 06:51:17 2007
@@ -263,14 +263,14 @@
             discardRMHeaders(header);
             
             Document doc = DOMUtils.createDocument();
-            SoapVersion version = Soap11.getInstance();
+            SoapVersion version = message.getVersion();
             Element hdr = doc.createElementNS(version.getHeader().getNamespaceURI(), 
                     version.getHeader().getLocalPart());
             // add WSRM namespace declaration to header, instead of
             // repeating in each individual child node
-            hdr.setAttributeNS("http://www.w3.org/2000/xmlns/",
-                                  "xmlns:" + RMConstants.getNamespacePrefix(),
-                                 RMConstants.getNamespace());
+//            hdr.setAttributeNS("http://www.w3.org/2000/xmlns/",
+//                                  "xmlns:" + RMConstants.getNamespacePrefix(),
+//                                 RMConstants.getNamespace());
             Marshaller marshaller = getJAXBContext().createMarshaller();
             marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
 
@@ -279,7 +279,14 @@
                            SequenceFaultType.class, 
                            hdr, 
                            marshaller);
-            header.add(new Header(new QName(hdr.getNamespaceURI(), hdr.getLocalName()), hdr));
+            Node node = hdr.getFirstChild();
+            if (node instanceof Element) {
+                ((Element)node).setAttributeNS("http://www.w3.org/2000/xmlns/",
+                        "xmlns:" + RMConstants.getNamespacePrefix(),
+                       RMConstants.getNamespace());
+            }
+            
+            header.add(new Header(new QName(node.getNamespaceURI(), node.getLocalName()),
node));
         } catch (SOAPException se) {
             LOG.log(Level.WARNING, "SOAP_HEADER_ENCODE_FAILURE_MSG", se); 
         } catch (JAXBException je) {
@@ -595,6 +602,7 @@
         return null;
     }
 }
+
 
 
 



Mime
View raw message