users@jaxb.java.net

Envelope has xmlns attributes for EVERY schema defined in WSDL, even if not referenced

From: KARR, DAVID (ATTSI) <"KARR,>
Date: Tue, 9 Nov 2010 10:41:58 -0800

I'm experimenting with using Apache CXF to consume some web services.

I have an existing service client that uses JAXB, with an ad hoc Soap
infrastructure. When I marshal the envelope in the existing code, I get
xmlns attributes for all the namespaces that are actually used in the
envelope, which isn't many. It only produces one application-specific
one.

Our WSDL defines a service with a large number of operations. Each one
of them has their own operation-specific schema.

When I now marshal the request with CXF, I get a request that is much,
much, larger than the original code. This is because it has xmlns
attributes for EVERY schema referenced in the WSDL, even though only one
is referenced in the operation. What's worse is that that huge list of
xmlns attributes is present in two places in the envelope, both on the
body child element and in an element in the header.

Is there some way I can get the envelope back closer to what I had
before?

I asked about this on the CXF list, but they replied that this isn't
something that CXF can control, it's entirely in the JAXB arena.