Dan*_*Dan 5 python xml soap suds
在python suds中,如何将原始XML节点插入到通过factory.create方法创建的对象中,同时仍然维护属性?我可以使用一些 _child 字段吗?基本上,如何将 s:any child 与 Raw() 一起使用?
我需要发送的内容:
<web:Script Format="raw">
<raw_xml_node foo="bar">stuff</raw_xml_node>
</web:Script>
Run Code Online (Sandbox Code Playgroud)
我使用以下命令创建 Script 对象:
>>> scr = client.factory.create('Script')
>>> scr._Format = "raw"
>>> print scr
(Script){
_Format = "raw"
}
Run Code Online (Sandbox Code Playgroud)
相关 WSDL:
<s:complexType name="Script">
<s:sequence>
<s:any/>
</s:sequence>
<s:attribute name="Format">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="xhtml"/>
<s:enumeration value="raw"/>
</s:restriction>
</s:simpleType>
</s:attribute>
</s:complexType>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1154 次 |
| 最近记录: |