-
suds调用webservice5
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
logging.getLogger('suds.wsdl').setLevel(logging.DEBUG)
from suds import WebFault
from suds.client import Client
from suds.xsd.doctor import Import
from suds.xsd.doctor import ImportDoctor
imp = Import('http://www.w3.org/2001/XMLSchema')
imp.filter.add('http://WebXml.com.cn/')
doctor = ImportDoctor(imp)
url = 'http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx?WSDL'
client = Client(url,doctor=doctor)
print (client)
print (client.service.getWeather('58367'))
运行结果如下
DEBUG:suds.wsdl:reading wsdl at: http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx?WSDL ...
DEBUG:suds.wsdl:binding: "WeatherWSHttpGet" not a soap binding
DEBUG:suds.wsdl:binding: "WeatherWSHttpPost" not a soap binding
DEBUG:suds.wsdl:binding "WeatherWSHttpGet" - not a soap, discarded
DEBUG:suds.wsdl:binding "WeatherWSHttpPost" - not a soap, discarded
Traceback (most recent call last):
File "E:\python project\Python_WebService\src\WebServie.py", line 19, in <module>
client = Client(url,doctor=doctor)
File "build\bdist.win32\egg\suds\client.py", line 112, in __init__
File "build\bdist.win32\egg\suds\reader.py", line 152, in open
File "build\bdist.win32\egg\suds\wsdl.py", line 159, in __init__
File "build\bdist.win32\egg\suds\wsdl.py", line 220, in build_schema
File "build\bdist.win32\egg\suds\xsd\schema.py", line 93, in load
File "build\bdist.win32\egg\suds\xsd\schema.py", line 305, in open_imports
File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 542, in open
File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 563, in download
File "build\bdist.win32\egg\suds\xsd\schema.py", line 397, in instance
File "build\bdist.win32\egg\suds\xsd\schema.py", line 226, in __init__
File "build\bdist.win32\egg\suds\xsd\schema.py", line 305, in open_imports
File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 542, in open
File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 560, in download
File "build\bdist.win32\egg\suds\reader.py", line 79, in open
File "build\bdist.win32\egg\suds\reader.py", line 95, in download
File "build\bdist.win32\egg\suds\transport\https.py", line 60, in open
File "build\bdist.win32\egg\suds\transport\http.py", line 62, in open
File "build\bdist.win32\egg\suds\transport\http.py", line 118, in u2open
File "C:\Python27\lib\urllib2.py", line 394, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 412, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1199, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Python27\lib\urllib2.py", line 1170, in do_open
r = h.getresponse(buffering=True)
File "C:\Python27\lib\httplib.py", line 1027, in getresponse
response.begin()
File "C:\Python27\lib\httplib.py", line 407, in begin
version, status, reason = self._read_status()
File "C:\Python27\lib\httplib.py", line 371, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine: ''
2012年3月01日 20:57
目前还没有答案
相关推荐
今天小编就为大家分享一篇python使用suds调用webservice接口的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
主要介绍了python suds访问webservice服务实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧
使用suds这个第三方模块 from suds.client import ...之前查看接口信息时,未发现tns=”http://Localhost:4567/Interface.wsdl”,这个被设置成Localhost,导致通过接口调用时,只能在webservice接口本地服务器上
suds-jurko-0.6.zip:python调用webservice的包,suds-jurko-0.6.zip:python调用webservice的包
webservice interface call by python
一、使用python3做webervice接口测试的第三方库选择suds-jurko库,可以直接pip命令直接下载,也可以在pypi官网下载压缩包进行手动安装 二、安装好后,导入...# 打印所有webservice接口信息 print(client) 但是会出现
python写的一个通用webservice client 涉及suds,logging,threading,wxpython
NULL 博文链接:https://huangfang7891-gmail-com.iteye.com/blog/1893536
suds包,其中包括XMLSchema.xsd 和xml.xsd
资源分类:Python库 所属语言:Python 资源全名:suds-ews-0.3.7.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
python-suds-0.4.1.tar.gz
资源来自pypi官网。 资源全名:suds-jurko-0.4.1.jurko.4.tar.bz2
Python调用webservice接口包工具
不支援 我不再支持该库-您可以查看其中一个派生版以获取最新版本。 Suds:JavaScript SOAP客户端库 XML就像暴力-如果它不能解决您的问题,那么您可能使用的不够多。... endpoint: "http://webservice.webserv
Python3.x访问webservice所需要的第三方库。 具体安装方法请看我的新浪博客,ID My城
一个python写的通用webservice client 涉及技术suds,wxpython,logging,base64
离线安装包,亲测可用
Suds是LGPL许可下的Python轻量级基于SOAP的Web服务客户端(请参阅发行版中包含的LICENSE.txt文件)。 这是jurko分支的社区分支。 分叉的项目信息 项目站点 可以从以下网站下载官方版本: Github- PyPI- //pypi....