我想用python(C-Python)使用Sharepoint
有人曾尝试过这个吗?
我怀疑自从这个问题得到解答后,SUDS库已经更新,以便自行处理所需的身份验证.在跳过各种篮球之后,我发现了这个诀窍:
from suds import WebFault from suds.client import * from suds.transport.https import WindowsHttpAuthenticated user = r'SERVER\user' password = "yourpassword" url = "http://sharepointserver/_vti_bin/SiteData.asmx?WSDL" ntlm = WindowsHttpAuthenticated(username = user, password = password) client = Client(url, transport=ntlm)
获取wsdl:
import sys # we use suds -> https://fedorahosted.org/suds from suds import WebFault from suds.client import * import urllib2 # my 2 url conf # url_sharepoint,url_NTLM_authproxy import myconfig as my # build url wsdl = '_vti_bin/SiteData.asmx?WSDL' url = '/'.join([my.url_sharepoint,wsdl]) # we need a NTLM_auth_Proxy -> http://ntlmaps.sourceforge.net/ # follow instruction and get proxy running proxy_handler = urllib2.ProxyHandler({'http': my.url_NTLM_authproxy }) opener = urllib2.build_opener(proxy_handler) client = SoapClient(url, {'opener' : opener}) print client.wsdl
主(平均)问题:sharepoint-server使用NTLM-Auth [:-(]所以我不得不使用NTLM-Auth-Proxy
致Rob和Enzondio:感谢您的提示!