我已经使用来自Salesforce提供的PHP工具包的phpTookit连接salesforce,但今天我得到了一个使用phptoolkit连接到salesforece沙箱的要求,有没有办法连接。
答案 0 :(得分:2)
在调用createConnection后调用SforceEnterpriseClient对象上的setEndpoint,并将端点设置为https://test.salesforce.com
端点:
define("USERNAME", "username@example.com.sandboxname");
define("PASSWORD", "yourpassword");
define("SECURITY_TOKEN", "securitytoken");
require_once ('soapclient/SforceEnterpriseClient.php');
$mySforceConnection = new SforceEnterpriseClient();
$mySforceConnection->createConnection("soapclient/enterprise.wsdl.xml");
// this sets the endpoint for a sandbox login:
$mySforceConnection->setEndpoint('https://test.salesforce.com/services/Soap/c/32.0');
$mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);
以上代码取自Force.com Toolkit for PHP示例,setEndpoint行是添加到连接到沙箱的行。
答案 1 :(得分:1)
连接到生产和连接到沙箱salesforce-org之间的唯一区别是: