Ladon control order of elements inside LadonType

孤街浪徒 提交于 2019-12-12 00:56:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!