I use below code to authenticate in SharePoint in my view:
import suds
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
from suds.client import Client
url = 'http://portal:8080/rashno/_vti_bin/lists.asmx?WSDL'
from suds.transport.https import WindowsHttpAuthenticated
ntlm = WindowsHttpAuthenticated(username='***', password='***')
client = Client(url, transport=ntlm)
But i got this error:
<urlopen error [Errno -3] Temporary failure in name resolution>
but when do this with python shell , it authenticate me in sharepoint and after that i can use other sharepoint service with view or shell. can any one tell me whats the problem?
A failure in name resolution indicates a DNS query failure.
From the machine where the script is failing, can you run 'ping portal' and/or 'nslookup portal' and see if an IP is returned (even if the ping fails)? Are the failures occurring in the view on the same machine (and virtual environment if applicable)?
Is 'portal' a static host entry (/etc/hosts on Linux)?
Does using the IP of the server instead of the name work? (it should unless your code validates SSL certificates and you don't have the IP as the CN or SAN or it is a self-signed certificate)
Does using the fully qualified name (ie portal.example.com) work?
As an aside, what version/fork of the suds library are you using? I would recommend against the regular suds library and instead using the suds-jurko package, also available via PyPi. It should be a drop-in replacement (almost literally, same imports and everything, so be sure to uninstall the old library), and has many bug fixes and optimizations. It is a fork of the original, since the original hasn't seen an update for close to five years. The fork fixed several WSDL consumption issues I encountered with the original.
https://bitbucket.org/jurko/suds
-James