Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

web services - Python suds "RuntimeError: maximum recursion depth exceeded while calling a Python object"

I'm trying to consume a SOAP web service using Python suds but I am getting the error "RuntimeError: maximum recursion depth exceeded while calling a Python object".

According to the trace, there is infinite recursion at "suds/binding/multiref.py", line 69.

The web service I'm trying to access is http://www.reactome.org:8080/caBIOWebApp/services/caBIOService?wsdl.

The method I'm trying to access is loadPathwayForId.

Here's the part of my code that consumes the web service:

from suds.client import Client
client = Client('http://www.reactome.org:8080/caBIOWebApp/services/caBIOService?wsdl')
pathway = client.service.loadPathwayForId(2470946)

I'm not sure what is responsible for the infinite recursion. I tried to look up this problem and there has been reports of issues with suds and infinite recursion, but the traces are different than mine (the recursive code is different), so I suspect my problem has other origins.

The full trace:

  File "C:Python27libsudsindingsmultiref.py", line 69, in update
      self.update(c)
  File "C:Python27libsudsindingsmultiref.py", line 69, in update
      self.update(c)
  ...
  File "C:Python27libsudsindingsmultiref.py", line 69, in update
      self.update(c)
  File "C:Python27libsudsindingsmultiref.py", line 69, in update
      self.update(c)
  File "C:Python27libsudsindingsmultiref.py", line 67, in update 
      self.replace_references(node)
  File "C:Python27libsudsindingsmultiref.py", line 80, in replace_references
      href = node.getAttribute('href')
  File "C:Python27libsudssaxelement.py", line 404, in getAttribute
      prefix, name = splitPrefix(name)
  File "C:Python27libsudssax\__init__.py", line 49, in splitPrefix
    if isinstance(name, basestring) 
RuntimeError: maximum recursion depth exceeded while calling a Python object

Thanks in advance for the help!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

After more testing, it seems that (unfortunately) suds has trouble interpreting Java Collection objects serialized as XML. I ended up using SOAPpy instead to avoid this issue. If someone can suggest a fix, that would be awesome! I really like suds for its other merits over SOAPpy.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...