You need to sign in to do that
Don't have an account?
bakum
INVALID_LOGIN issue
Hi, I'm getting a persistent INVALID_LOGIN problem...
I am 100% sure the username and password are right. I cut and paste them into the web login and that worked.
The wsdl is a fresh download from this morning and it is accessible in that spot.
here's the code. it's just a little POC for connecting to SF via PHP api and nothing is doing yet:
ini_set("soap.wsdl_cache_enabled", "0");
require_once (DIR_FS_SF_SOAP_CLIENT.'SforceEnterpriseClient.php');
require_once (DIR_FS_SF_SOAP_CLIENT.'SforceHeaderOptions.php');
try
{
$mySforceConnection = new SforceEnterpriseClient ();
$mySoapClient = $mySforceConnection->createConnection(DIR_FS_SF_SOAP_CLIENT."enterprise.wsdl.xml");
$mylogin = $mySforceConnection->login("XXX", "YYY");
$userResult = $mylogin->userInfo;
print_r($userResult);
echo $userResult->userFullName.', your session id is '.$mylogin->sessionId;
$query = 'SELECT * FROM Opportunity';
$response = $mySforceConnection->query(($query));
print_r($response);
foreach ($response->records as $record)
{
print_r($record);
}
print_r($mySforceConnection->getLastRequest());
$bagent = $_SERVER["HTTP_USER_AGENT"];
echo '<b>USER AGENT:</b> '.$bagent.'<br><br>';
}
catch (Exception $e)
{
echo $e->faultstring;
}
I am 100% sure the username and password are right. I cut and paste them into the web login and that worked.
The wsdl is a fresh download from this morning and it is accessible in that spot.
here's the code. it's just a little POC for connecting to SF via PHP api and nothing is doing yet:
ini_set("soap.wsdl_cache_enabled", "0");
require_once (DIR_FS_SF_SOAP_CLIENT.'SforceEnterpriseClient.php');
require_once (DIR_FS_SF_SOAP_CLIENT.'SforceHeaderOptions.php');
try
{
$mySforceConnection = new SforceEnterpriseClient ();
$mySoapClient = $mySforceConnection->createConnection(DIR_FS_SF_SOAP_CLIENT."enterprise.wsdl.xml");
$mylogin = $mySforceConnection->login("XXX", "YYY");
$userResult = $mylogin->userInfo;
print_r($userResult);
echo $userResult->userFullName.', your session id is '.$mylogin->sessionId;
$query = 'SELECT * FROM Opportunity';
$response = $mySforceConnection->query(($query));
print_r($response);
foreach ($response->records as $record)
{
print_r($record);
}
print_r($mySforceConnection->getLastRequest());
$bagent = $_SERVER["HTTP_USER_AGENT"];
echo '<b>USER AGENT:</b> '.$bagent.'<br><br>';
}
catch (Exception $e)
{
echo $e->faultstring;
}
Test is: " INVALID_LOGIN: Invalid username or password or locked out."
The account is not locked out and both username and password are correct!
-mb
Make sure that the account you are using to login has API access, look under Setup->Users->your user and check the API box.
--Alex
Anyway, took the $ out and everything went fine.