I am trying to use Python suds to access a SharePoint list by using a service but I am having some difficulties with the client component. I am behind a corporate firewall first of all which means that when the NTLM authentication works and suds gets the Lists.asmx?WSDL package it will try and go out on the internet to get the Schema. It fails.
So, I would l开发者_开发百科ike some help with proxies. I tried theClient.set_options( proxy = d )
where d is a dictionary and Suds complains with the following:
Client.set_options( proxy = d )
TypeError: unbound method set_options() must be called with Client instance
as first argument (got nothing instead)
Any Ideas?
Edit: So I found a workaround for this problem, that may/may not help the OP, but definitely helped me in the same situation. 'NTML' corrected typo.
The workaround is to cache the XMLSchema.xml file locally (see here: suds and soaplib without internet access)
import os.path
from suds.xsd import sxbasic
sxbasic.Import.bind('http://www.w3.org/2001/XMLSchema',
'file://' + os.path.join(ROOT_DIR, 'cache', 'suds', 'XMLSchema.xml'))
And save a local copy of XMLSchema.xml in ROOT_DIR/cache/suds/.
The ideal solution would be set up NTLM Authentication AND a proxy for suds, but I still haven't figured out how to do that...
精彩评论