肥皂水+ JIRA = SAX异常

发布于 2024-08-09 02:16:42 字数 1757 浏览 7 评论 0原文

我使用 Python 2.6 和 suds 0.3.7 与 JIRA 4.0 交互。

当我连接到 JIRA 服务器时,我可以很好地获取所有问题的信息。

但是,当我想更新问题时,我从 suds 收到 SAXException(大概):

WebFault:服务器引发故障: org.xml.sax.SAXException:反序列化时在数组元素内找到字符数据

我正在按照此处描述的步骤操作: http://confluence.atlassian.com/display/JIRA/Creating+a+SOAP+Client

仅用肥皂水替换 SOAPpy 调用。

我更新问题的尝试如下所示,但有例外:

 >>> w="http://bugs/rpc/soap/jirasoapservice-v2?wsdl"
 >>> from suds.client import Client
 >>> client = Client(w)
 >>> auth = client.service.login("myname","mypass")
 >>> issue = client.service.getIssue(auth,"BUG-30112")
 >>> issue.summary
 This is the original summary for BUG-30112
 >>> 
 >>> client.service.updateIssue(auth,"BUG-30112",[
 ...            {"id":"summary","values":["My new summary"]}])

 Traceback (most recent call last):
   File "<interactive input>", line 2, in <module>
   File "C:\Python26\lib\suds\client.py", line 535, in __call__
     return client.invoke(args, kwargs)
   File "C:\Python26\lib\suds\client.py", line 595, in invoke
     result = self.send(msg)
   File "C:\Python26\lib\suds\client.py", line 630, in send
     result = self.failed(binding, e)
   File "C:\Python26\lib\suds\client.py", line 681, in failed
     r, p = binding.get_fault(reply)
   File "C:\Python26\lib\suds\bindings\binding.py", line 235, in get_fault
     raise WebFault(p, faultroot)
 WebFault: Server raised fault: 'org.xml.sax.SAXException: Found character data inside an array element while deserializing'
 >>>

有人见过这样的问题吗?

I'm using Python 2.6 and suds 0.3.7 to interact with JIRA 4.0.

When I connect to the JIRA server, I get information on all the issues just fine.

However, when I want to update an issue, I get a SAXException from suds (presumably):

WebFault: Server raised fault:
org.xml.sax.SAXException: Found character data inside an array element while deserializing

I'm following the steps described here: http://confluence.atlassian.com/display/JIRA/Creating+a+SOAP+Client

only replacing SOAPpy calls with suds.

My attempt to update an issue looks like this, complete with exceptions:

 >>> w="http://bugs/rpc/soap/jirasoapservice-v2?wsdl"
 >>> from suds.client import Client
 >>> client = Client(w)
 >>> auth = client.service.login("myname","mypass")
 >>> issue = client.service.getIssue(auth,"BUG-30112")
 >>> issue.summary
 This is the original summary for BUG-30112
 >>> 
 >>> client.service.updateIssue(auth,"BUG-30112",[
 ...            {"id":"summary","values":["My new summary"]}])

 Traceback (most recent call last):
   File "<interactive input>", line 2, in <module>
   File "C:\Python26\lib\suds\client.py", line 535, in __call__
     return client.invoke(args, kwargs)
   File "C:\Python26\lib\suds\client.py", line 595, in invoke
     result = self.send(msg)
   File "C:\Python26\lib\suds\client.py", line 630, in send
     result = self.failed(binding, e)
   File "C:\Python26\lib\suds\client.py", line 681, in failed
     r, p = binding.get_fault(reply)
   File "C:\Python26\lib\suds\bindings\binding.py", line 235, in get_fault
     raise WebFault(p, faultroot)
 WebFault: Server raised fault: 'org.xml.sax.SAXException: Found character data inside an array element while deserializing'
 >>>

Has anyone seen a problem like this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

猥琐帝 2024-08-16 02:16:42

如果您切换到 suds 3.0.9(测试版),这个问题将会得到解决……这是唯一一个可以解决这个问题的版本。

This will be solved if you switch to suds 3.0.9 (beta) ... the only one to have the fix.

聆听风音 2024-08-16 02:16:42

增加详细程度来查看正在发送的内容怎么样?或者使用wireshark。您也可以使用 SOAPpy 执行相同的操作并准确比较发送的内容。对我来说,调试肥皂错误通常是这样的:-/

~Matt

How about increasing the verbosity to see what is being sent? Or use wireshark. You could also do the same with SOAPpy and compare exactly what is sent. Debugging soap errors is usually like this for me :-/

~Matt

渔村楼浪 2024-08-16 02:16:42

实际上,只需将库从 suds 更改为 SOAPpy,一切就开始工作,无需其他修改。有点烦人。我跳过了 SOAPpy,因为与肥皂水相比,它似乎已被废弃并且安装起来更复杂。但 SOAPpy 可以工作!

谢谢大家。

Actually, by just changing the library from suds to SOAPpy, everything started working with no other modifications. Kind of annoying. I skipped SOAPpy because it seemed to have been abandoned and more complex to install, compared to suds. But SOAPpy works!

Thanks, all.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文