voglio usare Microsoft CRM webservice, ho provato questo codice:Connetti a Dynamics CRM con acqua e pitone
wsdl_url = 'http://crm-test:5555/CRMDeveleopment/XRMServices/2011/Organization.svc?wsdl'
username = 'user'
password = 'pass'
from suds.transport.https import WindowsHttpAuthenticated
from suds.client import Client
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
logging.getLogger('suds.transport').setLevel(logging.DEBUG)
ntlmTransport = WindowsHttpAuthenticated(username=username, password=password)
metadata_client = Client(wsdl_url, transport=ntlmTransport, cache=None)
ed ottengo questo errore:
Traceback (most recent call last):
File "crm.py", line 15, in <module>
metadata_client = Client(wsdl_url, transport=ntlmTransport)
File "/usr/lib/python2.7/site-packages/suds/client.py", line 112, in __init__
self.wsdl = reader.open(url)
File "/usr/lib/python2.7/site-packages/suds/reader.py", line 152, in open
d = self.fn(url, self.options)
File "/usr/lib/python2.7/site-packages/suds/wsdl.py", line 157, in __init__
self.open_imports()
File "/usr/lib/python2.7/site-packages/suds/wsdl.py", line 202, in open_imports
imp.load(self)
File "/usr/lib/python2.7/site-packages/suds/wsdl.py", line 314, in load
d = Definitions(url, options)
File "/usr/lib/python2.7/site-packages/suds/wsdl.py", line 159, in __init__
self.build_schema()
File "/usr/lib/python2.7/site-packages/suds/wsdl.py", line 220, in build_schema
self.schema = container.load(self.options)
File "/usr/lib/python2.7/site-packages/suds/xsd/schema.py", line 95, in load
child.dereference()
File "/usr/lib/python2.7/site-packages/suds/xsd/schema.py", line 323, in dereference
midx, deps = x.dependencies()
File "/usr/lib/python2.7/site-packages/suds/xsd/sxbasic.py", line 469, in dependencies
raise TypeNotFound(self.ref)
suds.TypeNotFound: Type not found: '(ManagedPropertyAttributeRequiredLevel, http://schemas.microsoft.com/xrm/2011/Contracts,)'
uscita per l'organizzazione
from suds import WebFault
from suds.client import *
from suds.transport.https import WindowsHttpAuthenticated
user = r'domain.net\username'
password = "password"
url = "http://crm-test:5555/XRMServices/2011/Organization.svc?wsdl"
ntlm = WindowsHttpAuthenticated(username = user, password = password)
client = Client(url, transport=ntlm)
print client
errore:
$ python organization.py
DEBUG:suds.transport.http:opening (http://crm-test.kavatelecom.net:5555/XRMServices/2011/Organization.svc?wsdl)
DEBUG:suds.transport.http:opening (http://crm-test.kavatelecom.net:5555/XRMServices/2011/Organization.svc?wsdl=wsdl0)
Traceback (most recent call last):
File "organization.py", line 15, in <module>
client = Client(url, transport=ntlm)
File "/usr/lib/python2.7/site-packages/suds/client.py", line 112, in __init__
self.wsdl = reader.open(url)
File "/usr/lib/python2.7/site-packages/suds/reader.py", line 152, in open
d = self.fn(url, self.options)
File "/usr/lib/python2.7/site-packages/suds/wsdl.py", line 157, in __init__
self.open_imports()
File "/usr/lib/python2.7/site-packages/suds/wsdl.py", line 202, in open_imports
imp.load(self)
File "/usr/lib/python2.7/site-packages/suds/wsdl.py", line 314, in load
d = Definitions(url, options)
File "/usr/lib/python2.7/site-packages/suds/wsdl.py", line 159, in __init__
self.build_schema()
File "/usr/lib/python2.7/site-packages/suds/wsdl.py", line 220, in build_schema
self.schema = container.load(self.options)
File "/usr/lib/python2.7/site-packages/suds/xsd/schema.py", line 95, in load
child.dereference()
File "/usr/lib/python2.7/site-packages/suds/xsd/schema.py", line 323, in dereference
midx, deps = x.dependencies()
File "/usr/lib/python2.7/site-packages/suds/xsd/sxbasic.py", line 469, in dependencies
raise TypeNotFound(self.ref)
suds.TypeNotFound: Type not found: '(ManagedPropertyAttributeRequiredLevel, http://schemas.microsoft.com/xrm/2011/Contracts,)'
Pensi di poter seguire questo post? Il passaggio a SOAP 1.1 ha risolto il problema? –
vuoi dire che devo usare la versione precedente di suds? – nim4n
È possibile pubblicare l'output da http: // crm-test: 5555/CRMDeveleopment/XRMServices/2011/Organization.svc? Wsdl –