使用Python通过SOAP进行SharePoint

时间:2009-07-03 09:33:07

标签: python sharepoint soap suds

我一直在遵循这里提到的解决方案 - 因为这正是我需要实现的目标;

how can i use sharepoint (via soap?) from python?

然而,当我运行此代码的最后一行时,我收到以下错误;

>>> 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'

关于如何解决这个问题的任何建议或建议!

1 个答案:

答案 0 :(得分:1)

根据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()

SoapClient的第一个参数不是string,而是Client类的对象。您的参数不是所需类的实例。