问题
I'm using Ladon to expose a webservice in Python. I've a LadonType
as followed:
class Message(LadonType):
msg_from = PORTABLE_STRING
reply1 = PORTABLE_STRING
reply2 = PORTABLE_STRING
department = PORTABLE_STRING
date = PORTABLE_STRING
Now when I generate WSDL, it appears something like this:
<xsd:complexType name="Message">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="date" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="department" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="msg-from" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="reply1" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="reply2" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
That is, order of the elements is changed in the generated WSDL from what I defined while writing the Message
class.
Also, in the soap response, there is no way to control each individual elements of a complex structure, and they are generated arbitrarily. But since in the generated WSDL,It's </xsd:sequence>
should not the order be maintained? My client also needs the order to be maintained.
Can I control and set a fixed order of elements inside a complex structure LadonType
object?
来源:https://stackoverflow.com/questions/22641823/ladon-control-order-of-elements-inside-ladontype