views:

418

answers:

1

I have been following the solution noted here - as this is exactly what I need to achieve;

http://stackoverflow.com/questions/218987/how-can-i-use-sharepoint-via-soap-from-python

however when I run one of the last lines of this code I get the following error;

>>> client = SoapClient(url, {'opener' : opener})

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "build\bdist.win32\egg\suds\client.py", line 456, in __init__
AttributeError: 'str' object has no attribute 'options'

Any advice or suggestion as to how to solve this most welcome!

+1  A: 

According to https://fedorahosted.org/suds/browser/trunk/suds/client.py?rev=504

434     class SoapClient:
...
445         """
446     
447         def __init__(self, client, method):
448             """
449             @param client: A suds client.
450             @type client: L{Client}
451             @param method: A target method.
452             @type method: L{Method}
453             """
454             self.client = client
455             self.method = method
456             self.options = client.options
457             self.cookiejar = CookieJar()

The first parameter of SoapClient is not a string but an object of the Client class. Your parameter is not an instance of the required class.

czuk