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

Ordering of elements in XSD Sequence not honoured #72

Open
Bouke opened this issue Feb 15, 2024 · 0 comments
Open

Ordering of elements in XSD Sequence not honoured #72

Bouke opened this issue Feb 15, 2024 · 0 comments

Comments

@Bouke
Copy link

Bouke commented Feb 15, 2024

I have the following sequence as defined in a wsdl:

<xs:complexType name="Purchase">
    <xs:sequence>
        <xs:element name="Customer" nillable="true" type="xs:string" />
        <xs:element name="Quantity" type="xs:double" />
    </xs:sequence>
</xs:complexType>

When I have the following Purchase:

{
    Quantity: '1',
    Customer: "Test",
}

I expect it to be serialised as:

<Purchase>
    <Customer>Test</Customer>
    <Quantity>1</Quantity>
</Purchase>

However it is serialised in the order I defined the keys, which doesn't match the xsd:

<Purchase>
    <Quantity>1</Quantity>
    <Customer>Test</Customer>
</Purchase>

As a result the server rejects the message claiming that it doesn't understand the Quantity element and expects Customer instead. A xs:sequence must be serialised in the defined order.

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