【问题标题】:passing file attachments in SOAP using suds使用 suds 在 SOAP 中传递文件附件
【发布时间】:2013-06-11 14:35:19
【问题描述】:

我们正在开发一个项目,其中 python 客户端对 Java 方法进行 RPC 调用

String uploadFile(String name, String Id)

现在,这个客户端代码必须发送一个附件!

def sendFile(self, Id, filePath):
    uploadFileMethod = getattr(self.client.service, "uploadFile")
    attachment_id = Id
    attachment_content = (filePath, attachment_id)
    with_soap_attachment(uploadFileMethod, attachment_content)

因为 suds 不支持附件,我很幸运地找到了一个提到它的脚本。脚本提到here

现在,当我执行时,我得到了错误

AttributeError: 'Client' object has no attribute 'location'
line 75, in with_soap_attachment

谁能帮助我为什么它会出现以及如何解决它?

谢谢

【问题讨论】:

  • 你有创建附件的脚本吗?该链接现在已失效

标签: python soap suds


【解决方案1】:

对我有用的是替换

request = Request(suds_method.client.location(), request_text)

request = Request(soap_method.location(), request_text)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-21
    相关资源
    最近更新 更多