Author: darran.lofthouse(a)jboss.com
Date: 2010-11-23 11:38:59 -0500 (Tue, 23 Nov 2010)
New Revision: 13317
Modified:
thirdparty/cxf/branches/cxf-2.2.6/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
Log:
[JBPAPP-5458] JBossWS CXF - IllegalArgumentException: Local part not allowed to be null
when using OpenSAML with CXF [CXF-2725]
Modified:
thirdparty/cxf/branches/cxf-2.2.6/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.6/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java 2010-11-23
13:04:16 UTC (rev 13316)
+++
thirdparty/cxf/branches/cxf-2.2.6/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java 2010-11-23
16:38:59 UTC (rev 13317)
@@ -97,7 +97,7 @@
}
public void writeStartElement(String local) throws XMLStreamException {
- newChild(document.createElement(local));
+ newChild(document.createElementNS(null, local));
}
protected void newChild(Element element) {
@@ -169,7 +169,12 @@
}
public void writeAttribute(String local, String value) throws XMLStreamException {
- Attr a = document.createAttribute(local);
+ Attr a;
+ if (local.startsWith("xmlns") && (local.length() == 5 ||
local.charAt(5) == ':')) {
+ a = document.createAttributeNS(XML_NS, local);
+ } else {
+ a = document.createAttributeNS(null, local);
+ }
a.setValue(value);
((Element)currentNode).setAttributeNode(a);
}