users@jax-ws.java.net

Disabling xml declaration in JAX-WS

From: <sfrazier_at_gmo.com>
Date: Fri, 9 Sep 2011 20:02:33 +0000 (GMT)

Hi,

    I'm trying to use JAX-WS RI 2.2.1 to create a client that
communicates with a legacy web service at a different firm. The
validation layer on the server-side requires that all incoming messages
not contain an XML declaration. I've tried calling setOmitXmlDecl() on
the underlying SOAPMessage impl followed by a call to saveChanges()
inside a SOAPHandler. This appears to work in the scope of the
handler, but the XML declaration is still being added to the output.
It looks like the STAX API doesn't support turning off the XML
declaration so it's being added back in. Given this, are there any
games I can play using Tubes or other strategies to disable the xml
declaration in JAX-WS that are known to work? Thanks in advance for
any advice.

Regards,
Scott.