views:

64

answers:

2

The Microsoft Dynamics CRM service uses NTLM authentication, which makes connecting to it from a python process using suds somewhat complicated. I'm looking for a code sample that will:

  1. Send and receive the response from a RetrieveAttributeRequest
  2. Send and receive the response from an Execute request.

This must use Python 2.6 or Python 2.7, not Python 3. I already have a working implementation that uses curl to do this, but it's flaky at the best of times, and as part of some other work I have in this tool I'd like to clean it up and make it run using python/suds.

A: 

Hi Chris,

I try the same on MS Dynamics AX normal ERP version. I also tried it first with curl but I did not have success until now. Can you explain how your curl version works? I also tried suds but I have not found a solution yet. Maybe we can support each other.

THX Robert

Robert
Ask it as a question; that'll get more results.
Chris R
A: 

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.

William
Right now we use curl to do the work here, but that means that we have to handle serializing and deserializing the XML on each call, and building SOAP messages by hand is not fun. I'd rather a solution that abstracts that out, without having to write it by hand myself.
Chris R