How can I connect to a Microsoft Dynamics CRM server using Python?

我们两清 提交于 2019-11-30 07:44:28
Dan P.

I know this is a bit late but hopefully it will help someone.

NTLM authentication was added to suds in version 0.3.8.

from suds.transport.https import WindowsHttpAuthenticated
from suds.client import Client

url = 'http://crmurl/XRMServices/2011/Discovery.svc?wsdl'
ntlm = WindowsHttpAuthenticated(username='DOMAIN\username', password='password')
client = Client(url, transport=ntlm)

I don't know if this will be of help to you, but I used PycURL to get through an NTLM proxy.

Here's a code snippet:

    c = Curl()

    c.setopt(URL, 'http://www.somesite.com')
    c.setopt(FOLLOWLOCATION, 1)           # follow redirects
    c.setopt(MAXREDIRS, 5)              # max redirects
    c.setopt(PROXY, 'proxy.somesite.com')
    c.setopt(PROXYUSERPWD, 'DOMAIN/USER:PASSWORD')
    c.setopt(PROXYAUTH, HTTPAUTH_NTLM)    # use NTLM

    c.perform()

Here's the documentation on the Curl object.

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