users@jax-rpc.java.net

Re: serializing SOAPElement

From: Chrisjan Matser <chrisjan_at_sterrentech.com>
Date: Mon, 17 Jan 2005 09:08:05 -0800 (PST)

If you're just talking about System.out, you can
always take the SOAPElement, walk the tree and print
out the data anyway you like.

Start with the root SOAPElement and use methods like
getElementName().getLocalName(), getAllAttributes(),
and getChildElements().

Chrisjan

--- Sels Wannes <Wannes.Sels_at_cronos.be> wrote:

> Hi,
>
>
>
> 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
>
http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns/index
> 3.html (code sample 36):
>
>
>
> Transformer serializer =
> TransformerFactory.newInstance().newTransformer();
>
> serializer.transform(new
> DOMSource(parameters), new
> StreamResult(System.out));
>
>
>
> (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
> 'http://www.w3.org/XML/1998/namespace')
> 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
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net