gpt4 book ai didi

zeep - 用 Zeep 解析 WSDL

转载 作者:行者123 更新时间:2023-12-01 08:23:39 26 4
gpt4 key购买 nike

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

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

  • 有关解析 wsdl 的任何示例?

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

    /一种

    最佳答案

    更新:

    import operator
    from zeep import Client

    wsdl = 'http://www.soapclient.com/xml/soapresponder.wsdl'
    client = Client(wsdl=wsdl)
    for service in client.wsdl.services.values():
    print "service:", service.name
    for port in service.ports.values():
    operations = sorted(
    port.binding._operations.values(),
    key=operator.attrgetter('name'))

    for operation in operations:
    print "method :", operation.name
    print " input :", operation.input.signature()
    print " output:", operation.output.signature()
    print
    print

    关于zeep - 用 Zeep 解析 WSDL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44885439/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com