我在Python中使用suds库(版本4.0)作为soap客户端 wsdl 中没有定义模式位置,但供应商给了我们一些 xsd 文件。 现在我正在尝试为 url 和本地架构设置 suds 客户端。我可以这样做吗? 我已经看到很多使用 Import 和 ImportDoctor 解释的事情,但我不太明白它是否与我的情况有关。我想要这样的东西..
from suds.client import Client
url = "https://someurl?WSDL"
schemaLocation = "/some/local/Location/file.xsd"
client = Client(url,schemaLocation)
我知道这是错误的,但我怎样才能实现这样的目标
最佳答案
你可以使用这个:
url = "/some/local/Location/file.xsd" #xsd local location
new_url = "https://someurl?WSDL" #service url
c = Client(url)
c.sd[0].service.setlocation(new_url)
关于python - 当 wsdl 不包含时如何设置 suds 架构位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30112696/