gpt4 book ai didi

python - Python-Suds 联系 Sharepoint 时出现 403 禁止错误

转载 作者:太空宇宙 更新时间:2023-11-03 19:27:23 29 4
gpt4 key购买 nike

我正在使用 Python 的 SUD 库来访问 Sharepoint Web 服务。我遵循 Suds 网站上的标准文档。这两天,无论我访问哪个服务,远程服务总是返回403 Forbidden。

我使用的是 Suds 0.4,因此它内置了对访问 Python NTLM 的支持。

如果有人对此有任何线索,请告诉我。

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()

最佳答案

您是否将用户名指定为 DOMAIN\USER_ID,如 examples for the python-ntlm 中所示图书馆? (另请参阅this answer)。

关于python - Python-Suds 联系 Sharepoint 时出现 403 禁止错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7617900/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com