2015-06-05 84 views
0

我正在尝试使用下面的lib连接到Salesforce并获取以下问题,并且无法找到如何根据错误启用API的 。如何使用php连接salesforce?

https://github.com/developerforce/Force.com-Toolkit-for-PHP

代码: -

<?php 
 
error_reporting(E_ALL); 
 
ini_set("display_errors", 1); 
 
require_once ('soapclient/SforcePartnerClient.php'); 
 
$mySforceConnection = new SforcePartnerClient(); 
 

 

 

 
$mySoapClient = $mySforceConnection->createConnection("soapclient/partner.wsdl.xml"); 
 

 
$mylogin = $mySforceConnection->login("[email protected]", "pass#xa9Ur9xMD6qqdRhdmLBuiRev"); 
 
var_dump($mylogin);die; 
 

 
?> 
 

 

 
Fatal error: Uncaught SoapFault exception: [sf:API_DISABLED_FOR_ORG] API_DISABLED_FOR_ORG: 
 
API is not enabled for this Organization or Partner in 
 
/var/www/mssdev/force/soapclient/SforceBaseClient.php:168 Stack trace: 
 
#0 /var/www/mssdev/force/soapclient/SforceBaseClient.php(168): SoapClient->__call('login', Array) 
 
#1 /var/www/mssdev/force/soapclient/SforceBaseClient.php(168): SforceSoapClient->login(Array) 
 
#2 /var/www/mssdev/force/index.php(11): SforceBaseClient->login('[email protected]', 'fas#xa9Ur9...') 
 
#3 {main} thrown in /var/www/mssdev/force/soapclient/SforceBaseClient.php on line 168

回答

1

你可能使用Salesforce Gorup或专业版,其中API是不可用的。

其他情况(如果您有其他版本tham上面提到)API未启用您的用户。但是,从错误消息中,最可能的是场景#1。

0

使用开发者帐户,问题已解决。