分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > IT知识

第七篇:suds.TypeNotFound: Type not found: '(string, http://schemas.xmlsoap.org/soap/encoding/, )'

发布时间:2023-09-06 02:31责任编辑:赖小花关键词:httpxml

想要用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

第七篇:suds.TypeNotFound: Type not found: '(string, http://schemas.xmlsoap.org/soap/encoding/, )'

原文地址:https://www.cnblogs.com/apff/p/10317540.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved