当前位置:  开发笔记 > 编程语言 > 正文

我如何使用python的sharepoint(通过soap?)?

如何解决《我如何使用python的sharepoint(通过soap?)?》经验,为你挑选了2个好方法。

我想用python(C-Python)使用Sharepoint

有人曾尝试过这个吗?



1> somewhatoff..:

我怀疑自从这个问题得到解答后,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)



2> Blauohr..:

获取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:感谢您的提示!

推荐阅读
贴进你的心聆听你的世界
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有