function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tdoustdous 

INVALID_LOGIN on sandbox with Toolkit

Hi,


I know there are a few threads on this already - believe me I have been reading them. I am using the latest version of the PHP Toolkit I could find (13.1) and trying to I am attempting to access the Sandbox.

 

Here's what I have done:

 

  • Got a fresh enterprise and partner wsdl from the sandbox site and tried them both.
  • Made sure to include the sandbox name or whatever it's called at the end of the username, so email@address.com.thing
  • Refreshed the security token and appended that to the password.
  • Tried to use the WSDLs which come with the Toolkit instead, changing the endpoint to be test.salesforce.com/etc..

I noticed the endpoint in the Toolkit included "13" - since the toolkit is version 13, is there a more up to date version of the Toolkit to go with the latest API since the endpoint in the fresh WSDLs from my Sandbox is uses "20" instead of "13"?


All I'm doing so far is...

 

$sf = new SforceEnterpriseClient();
$sf->createConnection(WSDL_PATH);
$sf->login(array('username' => USERNAME, 'password' => PASSWORD . '.' . TOKEN));

 

And I get an error response of...

 

INVALID_LOGIN: Invalid username, password, security token; or user locked out.

 

I can login ok if I bypass the Toolkit...

 

$sf = new SoapClient(WSDL_PATH);
$result = $sf->login(array('username' => USERNAME, 'password' => PASSWORD . '.' . TOKEN));

 

But the only problem then is obviously spending the time working out how to do what I need to do (create leads) without the Toolkit's helper methods, so I'd obviously rather rather use the Toolkit if I can.


Any advice would be gratefully received!

 

EDIT: forgot to mention that I have used ini_set("soap.wsdl_cache_enabled", "0"); too but that didn't help.

Park Walker (TAGL)Park Walker (TAGL)

There shouldn't be a period between your password and the security token.

 

'password' => PASSWORD . TOKEN
not 
'password' => PASSWORD . '.' . TOKEN

 

You should be able to change the 13 to 20 without causing any problems, or you can use the 13 if you do not require any features made available since that release.

 

Park

tdoustdous

 


Redsummit wrote:

There shouldn't be a period between your password and the security token.


It doesn't work without that '.' either ;)

 

I shouldn't have pasted the code here with that in - that was actually just the final last ditch attempt I made before posting this thread.

 

msimondsmsimonds

What about modifying your code to have variables:

 

 

$wsdl = './includes/soapclient/partner.wsdl.xml';
$userName = "xxx@xxx.com";
$password = "xxxx";
$key = 'xxxxxx';

$password = $password . $key;