示例#1
0
文件: bulk.py 项目: mickle00/geektool
def getSalesforceSessionID():
    ## Logging in using the Salesforce-Python-SOAP-Toolkit
    ## TODO Figure out oauth2
    username, password, securitytoken = getCredentials()
    h = SforceEnterpriseClient("wsdl.jsp.xml")
    h.login(username, password, securitytoken)
    return h.getSessionId()
示例#2
0
def doLogin():
	username, password, securitytoken = getCredentials()
        scriptDir = os.path.split(os.path.abspath(__file__))[0]
        wsdlFile = os.path.join(scriptDir, '..', 'config', 'wsdl.jsp.xml')
        h = SforceEnterpriseClient(wsdlFile)
	result = h.login(username, password, securitytoken)
	return result['sessionId']
示例#3
0
def getSessionId():
    username, password, securitytoken = getCredentials()
    scriptDir = os.path.split(os.path.abspath(__file__))[0]
    wsdlFile = os.path.join(scriptDir, '..', 'config', 'wsdl.jsp.xml')
    h = SforceEnterpriseClient(wsdlFile)
    result = h.login(username, password, securitytoken)
    header = h.generateHeader('SessionHeader')
    header.sessionId = result['sessionId']
#    print result
    return header.sessionId
示例#4
0
def metaDataLogin():
	username, password, securitytoken = getCredentials()
	h = SforceEnterpriseClient('config/wsdl.jsp.xml')
	result = h.login(username, password, securitytoken)
	header = h.generateHeader('SessionHeader')
	header.sessionId = result['sessionId']
	#MetaData WSDL does not have a login call. Use Enterprise WSDL to get SessionID
	#All future calls need metadata WSDL
	metaDataClient = SforceEnterpriseClient('config/metadata.xml')
	metaDataClient.setSessionHeader(header)
	metaDataClient._setHeaders()
	metaDataClient._sforce.set_options(location = result.metadataServerUrl)
	return metaDataClient
示例#5
0
def apexAPILogin():
    username, password, securitytoken = getCredentials()
    scriptDir = os.path.split(os.path.abspath(__file__))[0]
    wsdlFile = os.path.join(scriptDir, '..', 'config', 'wsdl.jsp.xml')
    h = SforceEnterpriseClient(wsdlFile)
    result = h.login(username, password, securitytoken)
    header = h.generateHeader('SessionHeader')
    header.sessionId = result['sessionId']
    #ApexAPI WSDL does not have a login call. Use Enterprise WSDL to get SessionID
    #All future calls need ApexAPI WSDL
    apexFile = os.path.join(scriptDir, '..', 'config', 'apex.xml')
    ApexAPIClient = SforceEnterpriseClient(apexFile)
    ApexAPIClient.setSessionHeader(header)
    ApexAPIClient._setHeaders()
    ApexAPIClient._sforce.set_options(location = getApexAPIUrl(result.serverUrl))
    return ApexAPIClient
示例#6
0
def doLogin():
	username, password, securitytoken = getCredentials()
	h = SforceEnterpriseClient('../config/wsdl.jsp.xml')
	result = h.login(username, password, securitytoken)
	return result['sessionId']