我正在尝试使用 Soap API 将一些文件附加到 Jira。 我有 python 2.6 并且 SOAPpy 不再工作,所以,我正在使用 suds。除了附件之外一切都很好...我不知道如何重写这段代码:http://confluence.atlassian.com/display/JIRA/Creating+a+SOAP+Client?focusedCommentId=180943#comment-180943
有什么线索吗? 我不知道如何处理像这样的复杂类型:
<complexType name="ArrayOf_xsd_base64Binary">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:byte[][]"/>
</restriction>
</complexContent>
</complexType>
非常感谢
n.
最佳答案
如果您不想使用 Java CLI,下面是如何在 Python 中添加和附件。
from suds.client import Client
client = Client(url_to_wsdl_file)
auth = client.service.login(username, password)
client.service.addBase64EncodedAttachmentsToIssue(auth, issue_key, [filename.encode("utf-8")], [open(full_path_and_filename, "rb").read().encode('base64')])
关于Python+ SOAP 水 : xsd_base64Binary type?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2283219/