cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r537057 - in /incubator/cxf/trunk: common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java
Date Fri, 11 May 2007 01:00:29 GMT
Author: dkulp
Date: Thu May 10 18:00:28 2007
New Revision: 537057

URL: http://svn.apache.org/viewvc?view=rev&rev=537057
Log:
[CXF-642, CXF-643] Patches from Jeff Genender.   Thanks!


Modified:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?view=diff&rev=537057&r1=537056&r2=537057
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
(original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
Thu May 10 18:00:28 2007
@@ -25,6 +25,7 @@
 import java.io.Writer;
 import java.util.logging.Logger;
 
+import javax.xml.namespace.NamespaceContext;
 import javax.xml.namespace.QName;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.stream.StreamFilter;
@@ -54,7 +55,6 @@
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.helpers.XMLUtils;
 
-
 public final class StaxUtils {
 
     private static final Logger LOG = Logger.getLogger(StaxUtils.class.getName());
@@ -782,11 +782,12 @@
 
     public static String getUniquePrefix(XMLStreamWriter writer) {
         int n = 1;
-
+        
+        NamespaceContext nc = writer.getNamespaceContext();
         while (true) {
             String nsPrefix = "ns" + n;
 
-            if (writer.getNamespaceContext().getNamespaceURI(nsPrefix) == null) {
+            if (nc == null || nc.getNamespaceURI(nsPrefix) == null) {
                 return nsPrefix;
             }
 

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java?view=diff&rev=537057&r1=537056&r2=537057
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java
Thu May 10 18:00:28 2007
@@ -63,9 +63,10 @@
             }
 
             String ns = message.getVersion().getNamespace();
-            String defaultPrefix = StaxUtils.getUniquePrefix(writer, ns, true);
+            String defaultPrefix = StaxUtils.getUniquePrefix(writer, ns, false);
 
             writer.writeStartElement(defaultPrefix, "Fault", ns);
+            writer.writeNamespace(defaultPrefix, ns);
 
             writer.writeStartElement("faultcode");
 



Mime
View raw message