Zeep:无效的xsd类型或元素警告warnstrexc

问题描述

当我尝试在Python中使用Zeep创建Soap客户端时,收到警告,提示wsdl:message 包含无效部分('X1'):无效的xsd类型或elementswarnings.warn(str(exc)) 。 Zeep创建客户端,但没有任何服务。我尝试连接的soap API需要客户端证书(cert.pem)。我的代码如下:

from zeep import Client
from zeep.transports import Transport
from requests import Session

wsdl_url = r"https://XXXXXXXXX?WSDL"
client_cert_pem = 'cert.pem'

session = Session()
session.cert = client_cert_pem
transport = Transport(session=session)

client = Client(
    wsdl=wsdl_url,transport=transport
)

我得到的警告如下:

C:\XXX\zeep\wsdl\wsdl.py:338: UserWarning: The wsdl:message for '{http://XXX}YYY' contains an invalid part ('X1'): invalid xsd type or elements
  warnings.warn(str(exc))
C:\XXX\zeep\wsdl\wsdl.py:338: UserWarning: The wsdl:message for '{http://XXX}ZZZ' contains an invalid part ('X2'): invalid xsd type or elements
  warnings.warn(str(exc))
C:\XXX\zeep\wsdl\wsdl.py:338: UserWarning: The wsdl:message for '{http://XXX}VVV' contains an invalid part ('X3'): invalid xsd type or elements
  warnings.warn(str(exc))
C:\XXX\zeep\wsdl\deFinitions.py:137: UserWarning: The wsdl:operation 'XXX' was not found in the wsdl:portType '{XXX}VVV'
  warnings.warn(str(exc))
C:\XXX\zeep\wsdl\deFinitions.py:137: UserWarning: The wsdl:operation 'XXX' was not found in the wsdl:portType '{XXX}YYY'
  warnings.warn(str(exc))
C:\XXX\zeep\wsdl\deFinitions.py:137: UserWarning: The wsdl:operation 'XXX' was not found in the wsdl:portType '{XXX}ZZZ'
  warnings.warn(str(exc))
Forcing soap:address location to HTTPS

我希望有人可以帮助我解决这个问题

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)