zoukankan      html  css  js  c++  java
  • 第七篇:suds.TypeNotFound: Type not found: '(string, http://schemas.xmlsoap.org/soap/encoding/, )'

    想要用Python的suds模块调用webservice地址做自动测试,但是找了很多方法都失败了,最终找到另外一个模块可以作为客户端访问服务器地址。

    1.针对非安全的http

    from zeep import Client
    url = "http://***?wsdl"
    from zeep import Client
    client = Client(url)
    result = client.service.getCircuit('11111') # getCircuit 为服务端提供的接口服务,可以调用,括号中传相应的参数
    print(result)

    打印结果:

    {
    '_value_1': '{"errorMsg":"没有找到路由信息!"}',
    'id': None,
    'href': None,
    '_attr_1': {
    }
    }

    2.针对安全的https

    from requests import Session
    from zeep import Client
    from zeep.transports import Transport
    url = "https://***?wsdl"
    session = Session()    # 这里是因为url是https,不然不需要transport
    session.verify = False
    transport = Transport(session=session)
    client = Client(url)
    result = client.service.getCircuit('11111') # getCircuit 为服务端提供的接口服务,可以调用,括号中传相应的参数
    print(result)

     关于zeep可参考:https://python-zeep.readthedocs.io/en/master/index.html

    本文参考:https://blog.csdn.net/Ohmyberry/article/details/80430944?utm_source=blogxgwz4

  • 相关阅读:
    国际域名转出ICANN投诉
    C#中使用SslStream类来创建SSL服务器/客户端
    将.com域名转到godaddy的操作教程
    Google Test Automation Conference 2013 Schedule
    3月收藏
    4月收藏
    2月收藏
    5月收集
    stl中queues的基本用法
    codeblocks花屏终极解决方法
  • 原文地址:https://www.cnblogs.com/apff/p/10317540.html
Copyright © 2011-2022 走看看