in reply to Re^2: Preserve the sequence of xml elements in the generated SOAP Envelope
in thread Preserve the sequence of xml elements in the generated SOAP Envelope
The reason that the elements are not coming out in the order that you think you put them it, is that you are passing a hash reference as the second argument to SOAP::Data->name(), the elements in a hash are effectively in a random order which you cannot control. If you want more control over the structure of the generated XML you will need to explicitly create every element with SOAP::Data - you can find an example in Re: SOAP Beginner ... I hate to impose.
As to the question of why the elements need to be in a particular order, in general with XML this shouldn't matter but I have seen some XML parsers get upset about this when validating against a DTD, but you generally aren't doing this in a Web Service. If you (or the owner of the web service) care at all about interoperability, you will fix the server so that it behaves in an interoperable manner rather than hacking the client to work around it's quirks.
/J\
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Preserve the sequence of xml elements in the generated SOAP Envelope
by chanakya (Friar) on Apr 14, 2005 at 12:54 UTC | |
|
Re^4: Preserve the sequence of xml elements in the generated SOAP Envelope
by jhourcle (Prior) on Apr 14, 2005 at 11:11 UTC |