【问题标题】:how to set suds schema loction while wsdl doesn't contain one如何在 wsdl 不包含时设置 suds 模式位置
【发布时间】:2015-05-07 22:25:09
【问题描述】:

我在 python 中使用 suds 库(4.0 版)作为肥皂客户端 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)

我知道这是错误的,但我怎样才能实现这样的目标

【问题讨论】:

    标签: python soap xsd wsdl suds


    【解决方案1】:

    你可以用这个:

    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)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-17
      • 2019-03-03
      • 2016-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多