1

I have defined some prefixes-to-NS mapping in my package-info.java and my response is dynamic i.e. it may or may not contain certain elements corresponding to some of the NS defined.

I have observed that when my response is tiny, even then also Metro is adding all the namespaces in the root tag.

Is there a way to tell JAXB to not add those unnecessary namespaces in the response when there is no element, belonging to those namespaces, is present?

I'm using JDK 1.8 and WS implementation of version 2.3 in Metro.

Thanks!

Sanjeev Dhiman
  • 1,169
  • 1
  • 11
  • 20
  • See this answer. Worked for me http://stackoverflow.com/questions/4873429/controlling-namespace-prefixes-in-jaxb – rjdkolb Apr 21 '16 at 10:25

0 Answers0