serializing SOAPElement

From: Sels Wannes <>
Date: Mon, 17 Jan 2005 13:03:54 +0100



I'm having a 'problem' serializing a SOAPElement. I have an any in my
wsdl which is mapped to a SOAPElement. I copied the following code from
3.html (code sample 36):


Transformer serializer =

            serializer.transform(new DOMSource(parameters), new


(parameters is the SOAPElement). In the output I noticed that every
element has 10+ namespace declarations. Not all of them are used
(xmlns:xml is included, some parsers complain about this even though it
is set to the only correct value '')
and most of them only have to be declared on the root element anyway.


I've also tried the Xerces XMLSerializer, with the same result. I
realize this is probably a SAAJ problem, but I couldn't find any source
code to it, and the SAAJ mailing lists are as good as empty.


Does anyone know why this happens, and how I can output cleaner, more
readable xml?



Kind Regards,


Wannes Sels