python suds import 哪些,

imp.filter.add('http://webservice.webxml.com.cn/WebServices/')d = ImportDoctor(imp)client = Client(url, doctor=d)print client 错误信息 Traceback (most recent call last):File "weather.py", line 14, in client = Client(url, doctor=d)File "/usr/local/lib/python2...
python suds import 哪些,
正在学习python,使用suds用soap client遇到问题,代码如下,不是所有WebServices都出错,有些是可以的。注释中的url即使可以成功的。
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from suds.client import Client
from suds.xsd.doctor import ImportDoctor, Import
url = "http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx?wsdl"
#url = "http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl"
imp = Import('http://www.w3.org/2001/XMLSchema', location='http://www.w 3.org/2001/XMLSchema.xsd')
imp.filter.add('http://webservice.webxml.com.cn/WebServices/')
d = ImportDoctor(imp)
client = Client(url, doctor=d)
print client

错误信息
Traceback (most recent call last):
File "weather.py", line 14, in <module>
client = Client(url, doctor=d)
File "/usr/local/lib/python2.7/dist-packages/suds-0.4-py2.7.egg/suds/client.py", line 112, in __init__
self.wsdl = reader.open(url)
File "/usr/local/lib/python2.7/dist-packages/suds-0.4-py2.7.egg/suds/reader.py", line 152, in open
d = self.fn(url, self.options)
File "/usr/local/lib/python2.7/dist-packages/suds-0.4-py2.7.egg/suds/wsdl.py", line 159, in __init__
self.build_schema()
File "/usr/local/lib/python2.7/dist-packages/suds-0.4-py2.7.egg/suds/wsdl.py", line 220, in build_schema
self.schema = container.load(self.options)
File "/usr/local/lib/python2.7/dist-packages/suds-0.4-py2.7.egg/suds/xsd/schema.py", line 95, in load
child.dereference()
File "/usr/local/lib/python2.7/dist-packages/suds-0.4-py2.7.egg/suds/xsd/schema.py", line 323, in dereference
midx, deps = x.dependencies()
File "/usr/local/lib/python2.7/dist-packages/suds-0.4-py2.7.egg/suds/xsd/sxbasic.py", line 422, in dependencies
raise TypeNotFound(self.ref)
suds.TypeNotFound: Type not found: '(schema, http://www.w3.org/2001/XMLSchema, )'2014-02-19
mengvlog 阅读 8 次 更新于 2025-07-21 02:52:11 我来答关注问题0
檬味博客在线解答立即免费咨询

报错相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部