2015-12-18 16 views
0

我使用泡沫模塊通過Python連接到DynamicsCRM2011時遇到問題。我收到以下錯誤:使用Python和subs連接到DynamicsCRM2011

suds.transport.TransportError: HTTP Error 401: Unauthorized 

我當前的代碼:

from suds.transport.https import WindowsHttpAuthenticated 
from suds.client import Client 
import json, requests 
from suds.wsse import * 

url = 'https://crm.internal.website/internal.project/xrmservices/2011/OrganizationData.svc?WSDL' 

security = Security() 
token = UsernameToken('', '') 
token.setnonce('MyNonceString') 
token.setcreated(datetime.now()) 
security.tokens.append(token) 
ntlm = WindowsHttpAuthenticated(username='', password='') 
client = Client(url, transport=ntlm) 
client.set_options(wsse=security) 

在調試過程中,我可以看到,我不能在STS微軟服務器進行身份驗證。

任何幫助表示讚賞。至少有人能解釋認證過程如何與DynamicsCRM(2011)協同工作?

回答