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

Improve the namespace validation in xml to record conversion #7477

Open
Nuvindu opened this issue Dec 18, 2024 · 0 comments
Open

Improve the namespace validation in xml to record conversion #7477

Nuvindu opened this issue Dec 18, 2024 · 0 comments

Comments

@Nuvindu
Copy link
Contributor

Nuvindu commented Dec 18, 2024

Description

When defining a Ballerina record with a namespace prefix, an error occurs during XML conversion if the XML value uses a different prefix for the same namespace URI.

@xmldata:Namespace {prefix: "soap", uri: "http://schemas.xmlsoap.org/soap/envelope/"}
public type ResponseBody record {
    CheckPhoneNumberResponse CheckPhoneNumberResponse?;
};

If the XML value uses the prefix "s" instead of "soap" for the same namespace (http://schemas.xmlsoap.org/soap/envelope/), a namespace mismatch error occurs during the conversion process.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
        <CheckPhoneNumberResponse>
            <!-- Response details -->
        </CheckPhoneNumberResponse>
    </s:Body>
</s:Envelope>

Steps to Reproduce

  1. Define a Ballerina record with a namespace prefix ("soap").
  2. Attempt to convert an XML value using a different prefix ("s") but the same namespace URI.
  3. Observe the namespace mismatch error

Version

2201.10.2

Environment Details (with versions)

No response

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

No branches or pull requests

1 participant