Open MaximValeev opened 8 months ago
For now in version jaxb-runtime-4.0.4 nested elements don't inherit the root element namespace.
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { }) @XmlRootElement(name = "ResponseType", namespace = "http://www.anyurl.com/wsdl/") public class ResponseType { @XmlElement(required = true) protected String status; @XmlElement(required = true) protected String message;
Status and message will get "" namespace instead of XmlRootElement's namespace so i get unmarshalleing error if try to unmarshall:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://www.anyurl.com/wsdl/"> <soapenv:Header/> <soapenv:Body> <wsdl:ResponseType> <wsdl:status>01</wsdl:status> <wsdl:message>success</wsdl:message> </wsdl:ResponseType> </soapenv:Body> </soapenv:Envelope>
Unmarshalling Error: unexpected element (uri:"http://www.anyurl.com/wsdl/", local:"status"). Expected elements are <{}message>,<{}status>
There was no this issue in the 4.0.3 version.
This is the reason https://github.com/eclipse-ee4j/jaxb-ri/commit/2269a1d80914221a1be73026b7c2e94bb0a4f11f#r135406382
What is the correct behaviour? I have been supposing that child elements should inherit their parents namespace.
For now in version jaxb-runtime-4.0.4 nested elements don't inherit the root element namespace.
Status and message will get "" namespace instead of XmlRootElement's namespace so i get unmarshalleing error if try to unmarshall:
Unmarshalling Error: unexpected element (uri:"http://www.anyurl.com/wsdl/", local:"status"). Expected elements are <{}message>,<{}status>
There was no this issue in the 4.0.3 version.
This is the reason https://github.com/eclipse-ee4j/jaxb-ri/commit/2269a1d80914221a1be73026b7c2e94bb0a4f11f#r135406382
What is the correct behaviour? I have been supposing that child elements should inherit their parents namespace.