Suds + JIRA = SAXException

大兔子大兔子 提交于 2019-12-07 16:28:47

问题


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?


回答1:


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




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/1609666/suds-jira-saxexception

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!