+ Start a Discussion
piyush parmarpiyush parmar 

salesfroce connection using PHP toolkit,, its urgent

 

Hi all..
I am able to connect salesforce using PHP toolkit in sandbox.
But when i am try to connect production org i am getting this type of error.
Fatal error: Uncaught SoapFault exception: [INVALID_LOGIN] INVALID_LOGIN: Invalid username, password, security token; or user locked out. in /home/sites/public_html/sales/soapclient/SforceBaseClient.php:155 Stack trace: #0 [internal function]: SoapClient->__call('login', Array) #1 /home/sites//public_html/sales/soapclient/SforceBaseClient.php(155): SoapClient->login(Array) #2 /home/sites/public_html/sales/Upload.php(33): SforceBaseClient->login('username.', 'password+token') #3 {main} thrown in /home/sites/public_html/sales/soapclient/SforceBaseClient.php on line 155
here my username , password and security tokan is correct ,
than why i am getting this type of error ??
please reply me its urgent ..
Thank you 
piyush
Best Answer chosen by Admin (Salesforce Developers) 
b-Forceb-Force

one more addition,

Please make sure your SOAP EndPoint url contains https://test.salesforce.com/ not https://login.salesforce.com/

 

Thanks,

Bala

 

All Answers

NBlasgenNBlasgen

Simple.  Because your IP address hasn't been authorized.  Either use your Salesforce Token or authorize your IP address under Setup -> Security -> Network Access.

NBlasgenNBlasgen

Oh, you do say that your security token is correct.  I'm would have assumed that the security token from the sandbox and the production org would be the same, but you may want to check that.  The only other option is that your user account could have API access disabled.  Please check that setting as well.  It's under the Profile Settings for that paticular user.

b-Forceb-Force

one more addition,

Please make sure your SOAP EndPoint url contains https://test.salesforce.com/ not https://login.salesforce.com/

 

Thanks,

Bala

 

This was selected as the best answer
NBlasgenNBlasgen

b-Force, I now read his note again and I think that's exactly what the issue is.  Good job on that.

Sant Kumar YadavSant Kumar Yadav
Hi Piyush,
                 You have forget some basic steps. Follow the following link and connect your rest api.............

          require_once ('soapclient/SforcePartnerClient.php');
            require_once ('soapclient/SforceEnterpriseClient.php');
  
            define("USERNAME", "user@gmail.com");
            define("PASSWORD", "pass@123");
            define("SECURITY_TOKEN", "kahjsjgdgvs4657wkheku6sd");
   
                $mySforceConnection = new SforcePartnerClient(); 
                $mySforceConnection->createConnection("soapclient/partner.wsdl.xml");

If you have query then please let me know ?
Ruwantha  LankathilakaRuwantha Lankathilaka
Thanks NBlasgen , adding  Network Access worked for me.