SUDS SOAP "依赖项 suds.TypeNotFound: 找不到类型" 错误

0 投票
1 回答
1577 浏览
提问于 2025-04-17 17:49

我正在使用SUDS这个工具来处理WSDL(SOAP)网络服务,运行在GAE的Python环境下。

我想要使用这个46.51.221.138/PBExternalServices/v1/soap?wsdl的服务。

以下是我的Python代码

from suds.client import Client
client = Client(url) 
print client

但是在控制台上出现了一些错误,错误信息是:

  Traceback (most recent call last):
  File "soap.py", line 14, in <module>
    client = Client(url)
      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 95, in load
      File "build\bdist.win32\egg\suds\xsd\schema.py", line 323, in dereference
      File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 469, in dependencies
    suds.TypeNotFound: Type not found: '(GetAccountBalanceFaultResponse, http://www.
    payback.net/lmsglobal/xsd/v1/types, )'

注意:我看到有地方提到需要使用suds.xsd.doctor,因为这个WSDL似乎有点问题,但不幸的是,我不知道怎么在这里使用suds.xsd.doctor

所以,有没有人遇到过这个问题并解决了呢?如果有的话,请给我一些合适的建议,帮我解决这个问题。

温暖的问候,

Niks

1 个回答

2

以下内容对我有效:

from suds.client import Client
wsdl_url = 'http://46.51.221.138/PBExternalServices/v1/soap?wsdl'
client = Client(wsdl_url, autoblend=True)

撰写回答