【问题标题】:suds and choice tag泡沫和选择标签
【发布时间】:2011-08-23 05:36:08
【问题描述】:

如何使用“选择”参数生成对方法的请求?

http://127.0.0.1/service?wsdl 的 wsdl 的一部分:

... ... 选择>

当我这样做时

from suds.client import Client
client = Client("http://127.0.0.1/service?wsdl")
print client

我明白了

GetMethod()

没有任何参数。

如何使用 byA 或 byB 调用 GetMethod?

【问题讨论】:

    标签: python wsdl suds choice


    【解决方案1】:

    这是 suds 中的一个已知错误 https://fedorahosted.org/suds/ticket/342

    【讨论】:

      【解决方案2】:

      我修好了:

      class MyPlugin(DocumentPlugin):
          def setChoice(self, context):
              if not context.children:
                  return
              for i in context.children:
                  if i.name == "choice":
                      for j in i.children:
                          i.parent.append(j)
                  else:
                      self.setChoice(i)
      
          def parsed(self, context):
              self.setChoice(context.document)
      
      
      plugin = MyPlugin()
      client = Client("http://127.0.0.1/service?wsdl", plugins=[plugin])
      

      【讨论】:

        【解决方案3】:

        不看整个wsdl很难知道,你的链接是你的本地机器。

        Suds Client 类使用Service Class 作为与wsdl 交互的实例变量。你有没有尝试过这样的事情?

        from suds.client import Client
        client = Client("http://127.0.0.1/service?wsdl")
        client.service.GetMethod("byA")
        

        client.service.GetMethod("byB")

        【讨论】:

        • 不起作用 皂体为空
        • 再一次,不确定没有看到 wsdl。我描述的方法是 suds 如何调用 Web 服务上的方法。
        • 我知道如何调用 suds 方法,我不明白为什么 suds 不显示选择参数,也不处理 args(soap 主体为空)
        • 安德鲁,你找到解决办法了吗?
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-01-19
        相关资源
        最近更新 更多