I'm running into problems using sharepoint soap API.<br>This is my first time working with python, so I could be totally wrong. However, it seems that there is a bug in how SUDS handles attributes when the schema is defined by "any".<br>
<br>Here is the relative part of the schema:<br><s:element name="GetListItemsResponse"><br> <s:complexType><br> <s:sequence><br> <s:element minOccurs="0" maxOccurs="1" name="GetListItemsResult"><br>
<s:complexType mixed="true"><br> <s:sequence><br> <s:any /><br> </s:sequence><br> </s:complexType><br> </s:element><br> </s:sequence><br>
</s:complexType><br></s:element><br><br>And here is the relative part of the response:<br><GetListResult><br> <List DocTemplateUrl="" EmailInsertsFolder="" ><br>....<br>
<br>This fails with:<br>DEBUG:suds.resolver:searching parent (<Any:0x12fed28 />) for (@EmailInsertsFolder)<br>Traceback (most recent call last):<br> File "C:\development\IDEs\eclipse\workspace\cgi\sharepoint2jira\src\synch\sharepoint2jira.py", line 13, in <module><br>
list = client.service.GetList(listName='Issues List')<br> File "C:\development\python\python-suds-0.3.5\suds\client.py", line 240, in __call__<br> return target.call(*args, **kwargs)<br> File "C:\development\python\python-suds-0.3.5\suds\client.py", line 379, in call<br>
return method(*args, **kwargs)<br> File "C:\development\python\python-suds-0.3.5\suds\client.py", line 240, in __call__<br> return target.call(*args, **kwargs)<br> File "C:\development\python\python-suds-0.3.5\suds\client.py", line 422, in call<br>
return client.invoke(args, kwargs)<br> File "C:\development\python\python-suds-0.3.5\suds\client.py", line 480, in invoke<br> result = self.send(msg)<br> File "C:\development\python\python-suds-0.3.5\suds\client.py", line 505, in send<br>
result = self.succeeded(binding, reply.message)<br> File "C:\development\python\python-suds-0.3.5\suds\client.py", line 537, in succeeded<br> r, p = binding.get_reply(self.method, reply)<br> File "C:\development\python\python-suds-0.3.5\suds\bindings\binding.py", line 149, in get_reply<br>
result = unmarshaller.process(nodes[0], resolved)<br> File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 302, in process<br> return UMBase.process(self, content)<br> File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 87, in process<br>
data, result = self.append(content)<br> File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 103, in append<br> self.append_children(content)<br> File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 180, in append_children<br>
cdata, cval = self.append(cont)<br> File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 102, in append<br> self.append_attributes(content)<br> File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 156, in append_attributes<br>
self.append_attribute(name, value, content)<br> File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 389, in append_attribute<br> type = self.resolver.findattr(name)<br> File "C:\development\python\python-suds-0.3.5\suds\resolver.py", line 364, in findattr<br>
result, ancestry = self.getchild(name, parent)<br>ValueError: need more than 0 values to unpack<br><br>I was able to trace it down to the Any class in sxbasics.py returning self from get_attribute (which fails to unpack into 2 variables?) <br>
Changing the return to (None, []) fixes the problem, but I'm not sure if that's the correct fix or I'm just doing something wrong.<br><br>Thanks<br>