[SWS-329] SaajContentHandler shouldn't repeat namespace declarations Created: 14/Apr/08  Updated: 21/Jul/08  Resolved: 05/May/08

Status: Closed
Project: Spring Web Services
Component/s: Core
Affects Version/s: 1.0.2
Fix Version/s: 1.5.2

Type: Improvement Priority: Major
Reporter: Sven W√ľndrich Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

BEA WLS 9.2



 Description   

We have realized some WebServices with PayloadRootAnnotationMethodEndpointMapping and Jaxb2Marshaller. The resulting soap document is valid, but the namespace declarations are repeated on each element. The behavior depends on javax.xml.stream.isRepairingNamespaces implementation in the StaX OutputStream.

The repetition of the namespace declarations comes from SaajContentHandler.startElement(...). The statements

for (Iterator iterator = namespaces.keySet().iterator(); iterator.hasNext() {
String namespacePrefix = (String) iterator.next();
String namespaceUri = (String) namespaces.get(namespacePrefix);
child.addNamespaceDeclaration(namespacePrefix, namespaceUri);
}

adds the declarations. Now the Sun StaX (sjsxp.jar) removes the needless declarations and all is fine. But the BEA WLS StaX implementation leaves the declarations untouched.

Through JAXB2 all known namespaces are named on the first element (if there are used or not). So the resulting xml contains 70% namespace declarations and is very big. If there is no reason for the current implementation, please only add namespace declarations of the current element, not the start element.



 Comments   
Comment by Arjen Poutsma [ 21/Jul/08 ]

Closing issues in 1.5.2

Generated at Mon Dec 18 22:05:39 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.