예제 #1
0
def loginToSalesforce(username, password, sectoken):
    """
  Initializes global Salesforce connection handle, "sf"
  """
    global sf
    sf = SforceEnterpriseClient(wsdlFile)
    # API login seems to always need security token
    result = sf.login(username, password, sectoken)
    print('Connected to "%s"' % result.serverUrl)
    print('  as user "%s" Org Company Name: "%s" Org Id: "%s"' % \
      (result.userInfo.userFullName,
       result.userInfo.organizationName,
       result.userInfo.organizationId))
    print("  org type is %s sandbox" % (tern(result.sandbox, "", "NOT")))
    global invokingUser
    invokingUser = result.userInfo.userFullName
예제 #2
0
    def connection2(self):
        '''Behavior: Log in to Salesforce
           Return: Handle to connection

           Uses Salesforce Python Toolkit

           connection2 used for queryAll functionality not supported
           by Python Simple-Salesforce
        '''
        if '_connection2' not in self.__dict__:
            user      = self.conf['salesforce']['user']
            password  = self.conf['salesforce']['password']
            token     = self.conf['salesforce']['token']
            wsdl_file = self.conf['salesforce']['wsdl_file']
            h = SforceEnterpriseClient(wsdl_file)
            h.login(user, password, token)

            self._connection2 = h
        return self._connection2
 def setUp(self):
     if self.h is None:
         self.h = SforceEnterpriseClient('../enterprise.wsdl.xml')
         self.h.login(test_config.USERNAME, test_config.PASSWORD,
                      test_config.TOKEN)
def connect():
    c = SforceEnterpriseClient(environ.get('SF_WSDL_PATH'))
    c.login(environ.get('SF_LOGIN'), environ.get('SF_PWD'), environ.get('SF_TOKEN'))
    
    return c
예제 #5
0
def connect():
    c = SforceEnterpriseClient(SF_WSDL_PATH)
    c.login(SF_LOGIN, SF_PWD, SF_TOKEN)
    
    return c
예제 #6
0
def login():
    h = SforceEnterpriseClient('%s/skyhigh/wsdl/skyhigh_salesforce_enterprise.wsdl.xml' % settings.STATIC_ROOT)
    h.login(settings.SERVICE_CLOUD_USERNAME, settings.SERVICE_CLOUD_PASSWORD, settings.SERVICE_CLOUD_SECURITY_TOKEN)
    
    return h