2

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:\Python27\lib\suds\bindings\multiref.py", line 69, in update
      self.update(c)
  File "C:\Python27\lib\suds\bindings\multiref.py", line 69, in update
      self.update(c)
  ...
  File "C:\Python27\lib\suds\bindings\multiref.py", line 69, in update
      self.update(c)
  File "C:\Python27\lib\suds\bindings\multiref.py", line 69, in update
      self.update(c)
  File "C:\Python27\lib\suds\bindings\multiref.py", line 67, in update 
      self.replace_references(node)
  File "C:\Python27\lib\suds\bindings\multiref.py", line 80, in replace_references
      href = node.getAttribute('href')
  File "C:\Python27\lib\suds\sax\element.py", line 404, in getAttribute
      prefix, name = splitPrefix(name)
  File "C:\Python27\lib\suds\sax\__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!

1
  • Copy-paste full code traceback, please Commented Aug 27, 2013 at 4:42

2 Answers 2

0

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.

Sign up to request clarification or add additional context in comments.

Comments

0

I tried lots of SUDS versions and forks, and finally got to find one that works with proxies, https and authenticated services, find it here:

https://github.com/unomena/suds

Also, here is example code showing simple usage:

from suds.client import Client

# SOAP WSDL url
url = 'https://example.com/ws/service?WSDL'

# SOAP service username and password for authentication, if needed
username = 'user_name'
password = 'pass_word'

# local intranet proxy definition to get to the internet, if needed
proxy = dict(http='http://username:password@localproxy:8080',
             https='http://username:password@localproxy:8080')

# unauthenticaded, no-proxy
# client = Client(url)

# use a proxy to connect to the service
# client = Client(url, proxy=proxy)

# no proxy, authenticathed service
# client = Client(url, username=username, password=password)

# use a proxy to connect to an authenticated service
client = Client(url, proxy=proxy, username=username, password=password)

print client

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.