Python-Suds 联系 Sharepoint 的 403 禁止错误 [英] 403 Forbidden Error for Python-Suds contacting Sharepoint
本文介绍了Python-Suds 联系 Sharepoint 的 403 禁止错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 Python 的 SUD 库来访问 Sharepoint Web 服务.我遵循了 Suds 网站上的标准文档.过去2天,无论我访问哪个服务,远程服务总是返回403 Forbidden.
I'm using Python's SUDs lib to access Sharepoint web services. I followed the standard doc from Suds's website. For the past 2 days, no matter which service I access, the remote service always returns 403 Forbidden.
我使用的是 Suds 0.4,因此它内置了对访问 Python NTLM 的支持.
I'm using Suds 0.4 so it has built-in support for accessing Python NTLM.
如果有人对此有所了解,请告诉我.
Let me know if anyone has a clue about this.
from suds import transport
from suds import client
from suds.transport.https import WindowsHttpAuthenticated
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
ntlm = WindowsHttpAuthenticated(username='USER_ID', password='PASS')
c_lists = client.Client(url='https://SHAREPOINT_URL/_vti_bin/Lists.asmx?WSDL', transport=ntlm)
#c_lists = client.Client(url='https://SHAREPOINT_URL/_vti_bin/spsearch.asmx?WSDL')
#print c_lists
listsCollection = c_lists.service.GetListCollection()
推荐答案
您是否按照 python-ntlm 库的示例?(另见这个答案).
Are you specifying the username as DOMAIN\USER_ID
as indicated in examples for the python-ntlm library? (Also see this answer).
这篇关于Python-Suds 联系 Sharepoint 的 403 禁止错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文