Exemple #1
0
 def client(self):
     if not self.activated:
         return
     if self._client is not None:
         return self._client
     client = None
     try:
         url = self.url + '?wsdl'
         #fix 404 exception on login: http://goo.gl/V5o73
         client = get_suds_client(url, context=self.context, location=url)
     except ValueError:
         logger.error("invalid SOAP URL: client instanciation fail")
     except URLError:
         logger.error("Error !")
     valid = True  # try now to validate the existing client
     if client is not None:
         for method in METHODS:
             if not hasattr(client.service, method):
                 logger.error("invalid SOAP URL: no %s" % method)
                 valid = False
                 break
     if not valid:
         client = None
         msg = "client is none:%s %s %s"
         logger.error(msg % (self.url, self.username, self.password))
     else:
         self._client = client
     return client
 def client(self):
     if not self.activated:
         return
     if self._client is not None:
         return self._client
     client = None
     try:
         url = self.url + '?wsdl'
         #fix 404 exception on login: http://goo.gl/V5o73
         client = get_suds_client(url, context=self.context, location=url)
     except ValueError:
         logger.error("invalid SOAP URL: client instanciation fail")
     except URLError:
         logger.error("Error !")
     valid = True  # try now to validate the existing client
     if client is not None:
         for method in METHODS:
             if not hasattr(client.service, method):
                 logger.error("invalid SOAP URL: no %s" % method)
                 valid = False
                 break
     if not valid:
         client = None
         msg = "client is none:%s %s %s"
         logger.error(msg % (self.url, self.username, self.password))
     else:
         self._client = client
     return client
 def client(self):
     if not self.activated: return
     if self._client is not None:
         return self._client
     client = None
     try:
         url = self.url+'?wsdl'
         #fix 404 exception on login: http://stackoverflow.com/questions/6499770/why-am-i-getting-exception-404-unot-found-with-suds
         client = get_suds_client(url, context=self.context, location=url)
     except ValueError, e:
         logger.error("invalid SOAP URL: client instanciation fail")