cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r798570 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
Date Tue, 28 Jul 2009 15:41:43 GMT
Author: dkulp
Date: Tue Jul 28 15:41:42 2009
New Revision: 798570

URL: http://svn.apache.org/viewvc?rev=798570&view=rev
Log:
Use the writeDefaultNamespace if the namespace is empty instead of
writeNamespace with an empty string.

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java?rev=798570&r1=798569&r2=798570&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
Tue Jul 28 15:41:42 2009
@@ -26,6 +26,7 @@
 import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.cxf.common.i18n.BundleUtils;
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.Service;
@@ -77,7 +78,11 @@
                 }
                 xmlWriter.setPrefix(pfx, name.getNamespaceURI());
                 xmlWriter.writeStartElement(pfx, name.getLocalPart(), name.getNamespaceURI());
-                xmlWriter.writeNamespace(pfx, name.getNamespaceURI());
+                if (StringUtils.isEmpty(pfx)) {
+                    xmlWriter.writeDefaultNamespace(name.getNamespaceURI());
+                } else {
+                    xmlWriter.writeNamespace(pfx, name.getNamespaceURI());
+                }
             } catch (XMLStreamException e) {
                 throw new Fault(new org.apache.cxf.common.i18n.Message("STAX_WRITE_EXC",
BUNDLE), e);
             }



Mime
View raw message