用Zeep解析WSDL [英] Parse WSDL with Zeep

查看:323
本文介绍了用Zeep解析WSDL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I want to parse a WSDL file with Zeep and get out:

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

是否有解析wsdl的示例?

Any examples on parsing the wsdl?

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

I guess I should use zeep.wsdl and the parse_service method?

/A

推荐答案

已解决:

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

这篇关于用Zeep解析WSDL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆