cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1476734 - in /cxf/branches/2.6.x-fixes: ./ api/src/main/java/org/apache/cxf/staxutils/ rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/ systests/jax...
Date Sun, 28 Apr 2013 08:20:33 GMT
Author: ningjiang
Date: Sun Apr 28 08:20:33 2013
New Revision: 1476734

URL: http://svn.apache.org/r1476734
Log:
Merged revisions 1476732 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

................
  r1476732 | ningjiang | 2013-04-28 16:14:12 +0800 (Sun, 28 Apr 2013) | 9 lines
  
  Merged revisions 1476727 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1476727 | ningjiang | 2013-04-28 15:53:43 +0800 (Sun, 28 Apr 2013) | 1 line
    
    CXF-4990 fixed the namespace issue when thrown the fault from logical handle.
  ........
................

Added:
    cxf/branches/2.6.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/CustomSoapFault.java
      - copied unchanged from r1476732, cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/CustomSoapFault.java
    cxf/branches/2.6.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/FaultThrowingHandler.java
      - copied unchanged from r1476732, cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/FaultThrowingHandler.java
    cxf/branches/2.6.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/SoapFaultHandlerTest.java
      - copied unchanged from r1476732, cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/SoapFaultHandlerTest.java
    cxf/branches/2.6.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/soap_fault_beans.xml
      - copied unchanged from r1476732, cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/soap_fault_beans.xml
Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
    cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/W3CNamespaceContext.java
    cxf/branches/2.6.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java
    cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1476732
  Merged /cxf/trunk:r1476727

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

Modified: cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java?rev=1476734&r1=1476733&r2=1476734&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
(original)
+++ cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
Sun Apr 28 08:20:33 2013
@@ -120,7 +120,10 @@ public class W3CDOMStreamWriter implemen
             }
         }
         if (!(context instanceof W3CNamespaceContext)) {
-            context = new W3CNamespaceContext();
+            // set the outside namespace context
+            W3CNamespaceContext childContext = new W3CNamespaceContext();
+            childContext.setOutNamespaceContext(context);
+            context = childContext;
         }
         ((W3CNamespaceContext)context).setElement(element);
         currentNode = element;

Modified: cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/W3CNamespaceContext.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/W3CNamespaceContext.java?rev=1476734&r1=1476733&r2=1476734&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/W3CNamespaceContext.java
(original)
+++ cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/staxutils/W3CNamespaceContext.java
Sun Apr 28 08:20:33 2013
@@ -32,12 +32,18 @@ import org.w3c.dom.Node;
 
 public class W3CNamespaceContext implements NamespaceContext {
     private Element currentNode;
+    private NamespaceContext outNamespaceContext;
     
     public W3CNamespaceContext() {
     }
     public W3CNamespaceContext(Element el) {
         currentNode = el;
     }
+    
+    public void setOutNamespaceContext(NamespaceContext context) {
+        outNamespaceContext = context;
+    }
+    
     public String getNamespaceURI(String prefix) {
         String name = prefix;
         if (name.length() == 0) {
@@ -53,7 +59,14 @@ public class W3CNamespaceContext impleme
         if (e == null) {
             return null;
         }
-
+        // check the outside namespace URI
+        if (outNamespaceContext != null) {
+            String result = outNamespaceContext.getNamespaceURI(name);
+            if (result != null) {
+                return result;
+            }
+        }
+        
         Attr attr = e.getAttributeNode(name);
         if (attr == null) {
             Node n = e.getParentNode();
@@ -75,6 +88,14 @@ public class W3CNamespaceContext impleme
         if (e == null) {
             return null;
         }
+        // check the outside namespace URI
+        if (outNamespaceContext != null) {
+            String result = outNamespaceContext.getPrefix(uri);
+            if (result != null) {
+                return result;
+            }
+        }
+        
         NamedNodeMap attributes = e.getAttributes();
         if (attributes != null) {
             for (int i = 0; i < attributes.getLength(); i++) {

Modified: cxf/branches/2.6.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java?rev=1476734&r1=1476733&r2=1476734&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/AbstractEncodedTest.java
Sun Apr 28 08:20:33 2013
@@ -21,7 +21,6 @@ package org.apache.cxf.aegis.type.encode
 import java.io.ByteArrayInputStream;
 import java.io.UnsupportedEncodingException;
 import java.util.List;
-import java.util.Map;
 
 import javax.xml.stream.XMLStreamException;
 
@@ -89,7 +88,7 @@ public abstract class AbstractEncodedTes
 
         // write value to element
         Element element = writeRef(value);
-
+        
         // reread value from element
         value = typeClass.cast(readRef(element));
 
@@ -143,9 +142,10 @@ public abstract class AbstractEncodedTes
         // create the document
         Element element = createElement("urn:Bean", "root", "b");
         MapNamespaceContext namespaces = new MapNamespaceContext();
-        for (Map.Entry<String, String> entry : getNamespaces().entrySet()) {
+        // we should not add the out namespace here, as it is not a part of root element

+        /*for (Map.Entry<String, String> entry : getNamespaces().entrySet()) {
             namespaces.addNamespace(entry.getKey(), entry.getValue());
-        }
+        }*/
         ElementWriter rootWriter = getElementWriter(element, namespaces);
         Context context = getContext();
 

Modified: cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java?rev=1476734&r1=1476733&r2=1476734&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java
Sun Apr 28 08:20:33 2013
@@ -73,7 +73,12 @@ public class LogicalHandlerFaultOutInter
             Document doc = XMLUtils.newDocument();
             message.setContent(Node.class, doc);
             W3CDOMStreamWriter writer = new W3CDOMStreamWriter(doc);
-        
+            // set up the namespace context
+            try {
+                writer.setNamespaceContext(origWriter.getNamespaceContext());
+            } catch (XMLStreamException ex) {
+                // don't set the namespaceContext
+            }
             // Replace stax writer with DomStreamWriter
             message.setContent(XMLStreamWriter.class, writer);
             message.put(ORIGINAL_WRITER, origWriter);
@@ -81,7 +86,7 @@ public class LogicalHandlerFaultOutInter
             message.getInterceptorChain().add(ending);
         } catch (ParserConfigurationException e) {
             throw new Fault(e);
-        }
+        } 
     }
     
     



Mime
View raw message