After some more though, I thought of another way that this might be done. If there's a way to make the annotated classes somehow inherit the namespace from the class that called them, I wouldn't need to do anything else. I didn't mention this before, but the server responses are namespaced and unqualified, so in just XML terms, this inheritance is already kind of happening. I've tried doing this:
@XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "ServerResponse", namespace = "http://some.namespace.com/") public class ServerResponse{ @XmlElement(name = "Entries") protected Entries entries= new Entries(); public Entries getEntries() { return entries; } public void setEntries(Entries entries) { this.entries = entries; } } for the server response and using this for the request: @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "ServerResponse", namespace = "") public class ServerRequest{ @XmlElement(name = "Entries") protected Entries entries= new Entries(); public Entries getEntries() { return entries; } public void setEntries(Entries entries) { this.entries = entries; } } In this case the requests work, but the responses don't. JAXB seems to only unmarshall the root element, <ServerResponse> unless I explicitly annotate a namespace for the child <Entries> element as well. It doesn't throw an exception, mind you, it just doesn't set the "entries" member variable to anything. If these elements could just inherit the namespace of their parents, the way the actual XML seems to be calling for them to do, my problem would be fixed by just having two version of the top-level classes. -- View this message in context: http://cxf.547215.n5.nabble.com/Removing-namespaces-tp3380211p3381267.html Sent from the cxf-user mailing list archive at Nabble.com.
