Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Regress] Namespace inheritance by children element #1782

Open
MaximValeev opened this issue Jan 19, 2024 · 0 comments
Open

[Regress] Namespace inheritance by children element #1782

MaximValeev opened this issue Jan 19, 2024 · 0 comments

Comments

@MaximValeev
Copy link

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:https://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:https://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http:https://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:https://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 2269a1d#r135406382

What is the correct behaviour? I have been supposing that child elements should inherit their parents namespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant