我如何从Python使用sharepoint(通过soap?)?

发布于 2024-07-06 19:35:17 字数 62 浏览 6 评论 0原文

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

有人尝试过吗?

I want to use Sharepoint with python (C-Python)

Has anyone tried this before ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

一曲琵琶半遮面シ 2024-07-13 19:35:17

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

I suspect that since this question was answered the SUDS library has been updated to take care of the required authentication itself. After jumping through various hoops, I found this to do the trick:


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)

风情万种。 2024-07-13 19:35:17

要获得 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

main (mean) 问题:
sharepoint-server 使用 NTLM-Auth [ :-( ]
所以我不得不使用 NTLM-Auth-Proxy

来 Rob 和 Enzondio:感谢您的提示!

To get the 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

main (mean) problem:
the sharepoint-server uses a NTLM-Auth [ :-( ]
so i had to use the NTLM-Auth-Proxy

To Rob and Enzondio : THANKS for your hints !

冷…雨湿花 2024-07-13 19:35:17

使用 Python 进行 SOAP 非常简单。 这是来自 Dive Into Python 的教程

SOAP with Python is pretty easy. Here's a tutorial from Dive Into Python.

玩心态 2024-07-13 19:35:17

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

我不确定 Python 有哪些 Web 服务工具包,但它们应该能够毫无问题地为这些服务构建代理。

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

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

SharePoint exposes several web services which you can use to query and update data.

I'm not sure what web service toolkits there are for Python but they should be able to build proxies for these services without any issues.

This article should give you enough information to get started.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文