403 Forbidden Error for Python-Suds contacting Sharepoint

六眼飞鱼酱① 提交于 2019-12-11 05:47:34

问题


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.

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

回答1:


Are you specifying the username as DOMAIN\USER_ID as indicated in examples for the python-ntlm library? (Also see this answer).



来源:https://stackoverflow.com/questions/7617900/403-forbidden-error-for-python-suds-contacting-sharepoint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!