Python suds “RuntimeError: maximum recursion depth exceeded while calling a Python object”

前端 未结 2 1017
我在风中等你
我在风中等你 2020-12-12 01:51

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\".

相关标签:
2条回答
  • 2020-12-12 02:10

    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.

    0 讨论(0)
  • 2020-12-12 02:14

    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
    
    0 讨论(0)
提交回复
热议问题