我正在尝试调用需要Null(None)属性但将suds删除的服务。我需要发送..
<ns1:Body>
<ns0:QueryIntersection>
<ns0:intersectingRoad>
<ns2:RoadName xsi:nil="true"/>
<ns2:RoadType xsi:nil="true"/>
</ns0:intersectingRoad>
<ns0:subjectRoad>
<ns2:RoadName>BURKE</ns2:RoadName>
<ns2:RoadType>ROAD</ns2:RoadType>
</ns0:subjectRoad>
</ns0:QueryIntersection>
但suds删除了IntersectingRoad对象,仅发送
<ns1:Body>
<ns0:QueryIntersection>
<ns0:subjectRoad>
<ns2:RoadName>BURKE</ns2:RoadName>
<ns2:RoadType>ROAD</ns2:RoadType>
</ns0:subjectRoad>
</ns0:QueryIntersection>
如果我在IntersectingRoad对象中设置值之一,它将发送它并正常工作,但None也是有效的请求。这是我正在使用的代码的一部分...
Int1 = client.factory.create('ns2:IntersectingRoad')
Int1.RoadName = None
Int1.RoadType = None
Int2 = client.factory.create('ns2:SubjectRoad')
Int2.RoadName = "BURKE"
Int2.RoadType = "ROAD"
try:
Ints = client.service.QueryIntersection(Int1,Int2, )
except Exception as e:
print e.message
请帮忙!
慕村9548890
相关分类