daily pastebin goal
21%
SHARE
TWEET

Untitled

a guest Oct 2nd, 2017 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def makeSoapCall(self, action, service='incident.do?WSDL', session_id=None, **kwargs):
  2.         url = self.url + '/' + service
  3.         log.debug('Posting to URL: %s', url)
  4.  
  5.         logging.getLogger('suds.client').setLevel(logging.DEBUG)
  6.         # 1. Connect to the base SOAP_PATH
  7.         client = Client(url, username=self.soapUsername,
  8.                              password=self.soapPassword)
  9.         try:
  10.             method = getattr(client.service, action, None)
  11.             if method:
  12.                 response = method(**kwargs)
  13.             else:
  14.                 log.error("Unable to bind SOAP method %s for service %s",
  15.                           action, service)
  16.                 raise ServiceNowConnectionFailure
  17.         except Exception, e:
  18.             log.error("SOAP Error! %s", e)
  19.             raise ServiceNowConnectionFailure
  20.  
  21.         log.debug("Received SOAP response: %s\n%s", url, response)
  22.         return response
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top