我想将Sharepoint与python(C-Python)一起使用

以前有人试过吗?

有帮助吗?

解决方案

我怀疑自从这个问题得到解答后,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:感谢您的提示!

使用Python的SOAP非常简单。 Dive Into Python 这是一个教程

SharePoint公开了几种可用于查询和更新数据的Web服务。

我不确定Python的Web服务工具包是什么,但他们应该能够为这些服务构建代理而没有任何问题。

本文应该为您提供足够的信息以便开始使用。

http://www.developer.com/tech/article.php/3104621

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top