how can i use sharepoint (via soap?) from python?

前端 未结 4 1891
别那么骄傲
别那么骄傲 2020-12-13 22:17

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

Has anyone tried this before ?

4条回答
  •  执笔经年
    2020-12-13 23:01

    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 !

提交回复
热议问题