使用Zeep解析WSDL

时间:2017-07-03 12:20:30

标签: zeep

我想用Zeep解析一个WSDL文件并退出:

  • 所有操作
  • 为每项操作请求xml消息

有关解析wsdl的所有示例吗?

我想我应该使用zeep.wsdl和parse_service方法?

/ A

2 个答案:

答案 0 :(得分:4)

更新

{('key1','key2'): 50, ('key3','key4'): 70, ('key1','key5'): 90.....}

答案 1 :(得分:3)

解决:

client= Client('url_to_wsdl')
for service in client.wsdl.services.values():
    for port in service.ports.values():
        operations = sorted(
        port.binding._operations.values(),
        key=operator.attrgetter('name'))

        for operation in operations:
           print operation.name
           node = client.create_message(client.service, operation.name)
           print node