Community
Participate
Working Groups
When generating a schema from the following class: @XmlRootElement(name = "echoBarAndBarResponse", namespace = "http://echo.org/") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "echoBarAndBarResponse", namespace = "http://echo.org/") public class EchoTwoBarResponse { @XmlElement(name = "return", namespace = "urn:barresultns", nillable = true) private Bar[] _return; public Bar[] getReturn() { return this._return; } public void setReturn(Bar[] _return) { this._return = _return; } } public class Bar { private int age; public Bar() { } public Bar(int age) { this.age = age; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } } The type for the schema element "return" incorrectly references the schema type for Bar in the "urn:barresultns". In this case the schema type for Bar is in the "http://echo.org/" namespace, since "http://echo.org/" was specified as the defaultTargetNamespace and no @XmlType or @XmlSchema annotation has specified anything different.
Created attachment 189989 [details] Propsed Fix
Attached patch checked in to SVN Reviewed by Blaise Doughan
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink