node-soap icon indicating copy to clipboard operation
node-soap copied to clipboard

sequence is not respected

Open toughlex-donatas opened this issue 1 year ago • 3 comments

https://www.w3schools.com/xml/el_sequence.asp

The sequence element specifies that the child elements must appear in a sequence.

https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms256089(v=vs.100)

Requires the elements in the group to appear in the specified sequence within the containing element.

This library does not ensure this behavior.

Probably needed changes are somewhere here https://github.com/vpulim/node-soap/blob/15032f0484d606463684919c7aa1a8f9f77402bc/src/wsdl/index.ts#L748

toughlex-donatas avatar Dec 22 '24 13:12 toughlex-donatas

Hi @toughlex-donatas,

Could you please add a bit more details? How did you find this issue? Is there an example that you can share, like code snippet or xml file?

Thanks.

w666 avatar Dec 25 '24 19:12 w666

To replicate the problem you could create a test in https://github.com/vpulim/node-soap/blob/master/test/wsdl-test.js and use this wsdl https://github.com/vpulim/node-soap/blob/master/test/wsdl/marketo.wsdl Try to call GetLeadChanges for example, you will see that SOAP XML ParamsGetLeadChanges will not have its children ordered in correct order. There are APIs that don't work with unordered sequence elements.

toughlex-donatas avatar Dec 27 '24 08:12 toughlex-donatas

Had a look on it, does not look like an easy fix. Will have another look later when have more time.

w666 avatar Jan 06 '25 08:01 w666