Exemple #1
0
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()
Exemple #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']
Exemple #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
Exemple #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
Exemple #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
Exemple #6
0
def doLogin():
	username, password, securitytoken = getCredentials()
	h = SforceEnterpriseClient('../config/wsdl.jsp.xml')
	result = h.login(username, password, securitytoken)
	return result['sessionId']