2016-06-08 57 views
1

我已经在6或7岁的帖子中看到相关的问题,但还没有找到一个好的答案。 DELV_NUM元素位于WSDL中,但我相信它被标记为可选,并且mybe原因忽略了它。 我没有制作WSDL文件,也无法对其进行更改。如果我可以修改泡沫消息使其看起来像Soapui消息一样,那么响应应该可以正常工作。我仅限于修补和修改泡沫,因为它是Inductive Automation的Ignition平台的一部分。Suds消息缺少元素。 Soapui从WSDL创建正确的消息

这是从泡沫

enter image description here

发送的消息请求这是从SOAPUI使用相同的WSDL

enter image description here

我可以共享WSDL所述消息请求如果这会有所帮助。谢谢

回答

0

为了将元素添加到请求中,可以使用client.factory.create()方法。

解决方案能像这样工作:

# Create a Processing_Req object 
processing_req = client.factory.create('{http://wackerneuson.com/wn/in/Conveyor_Belt/ConveyorBeltProcessing}Processing_Req') 

# Create a Record object which is a child of Processing_Req 
record = client.factory.create('{http://wackerneuson.com/wn/if/Conveyor_Belt/ConveyorBeltProcessing}Processing_Req.record') 

# set the DELV_NUM element which is a child of the record element. 
record.DELV_NUM = '82934258' 

# append the new record object to the processing_req object 
processing_req.record.append(record) 

# make the request with the new record object created and populated 
request = client.service.Processing_OS(record) 
+0

这是我们如何解决这个问题 –