History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XFIRE-474
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Christoph Sturm
Reporter: Slawomir Ginter
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
XFire

Namespace context is handled improperly in W3CDOMStreamWriter.java

Created: 20/Jun/06 07:48 AM   Updated: 23/Jun/06 11:43 AM
Component/s: Core
Affects Version/s: 1.1.1
Fix Version/s: 1.2-RC, 1.1.2

Time Tracking:
Not Specified


 Description  « Hide
W3CDOMStreamWriter does not pop namespace context during writeEndElement()
As the result parent namespace is evaluated improperly during generation of message from DOM (WSS4J in my case)
in org.codehaus.xfire.aegis.stax.ElementWriter.writeStartElement() - getUniquePrefix would use the previous (already closed) element to compute the prefix, it will be evaluated improperly for every other element of the response (see down below)

Following patch in writeEndElement() resolves the issue for me:
Index: org/codehaus/xfire/util/stax/W3CDOMStreamWriter.java
===================================================================
— org/codehaus/xfire/util/stax/W3CDOMStreamWriter.java
+++ org/codehaus/xfire/util/stax/W3CDOMStreamWriter.java
@@ -117,4 +117,6 @@
else
currentNode = null;
+
+ ((W3CNamespaceContext)context).setElement(currentNode);
}

problematic response is:
<helloResponse xmlns="http://DefaultNamespace" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<out>
<par0 xmlns="http://name.pkg.some">0</par0>
<par1>1</par1>
<par2 xmlns="http://name.pkg.some">2</par2>
<s1>S1Value</s1>
<s2 xmlns="http://name.pkg.some">S2Value</s2>
<s3>S3Value</s3>
</out>
</helloResponse>



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Dan Diephouse - 20/Jun/06 10:05 AM
Thanks, scheduling this for 1.1.2

Christoph Sturm - 23/Jun/06 11:43 AM
applied your patch, thanks