gpt4 book ai didi

php - 使用 php 的 salesforce 沙箱连接

转载 作者:行者123 更新时间:2023-12-04 05:08:08 25 4
gpt4 key购买 nike

我已经使用 Salesforce 提供的 PHP 工具包中的 phpTookit 连接了 salesforce,但是今天我收到了一个要求,比如使用 phptoolkit 连接到 salesforece 沙箱,有什么方法可以连接。

最佳答案

在调用 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 行是添加到连接沙箱的行。

关于php - 使用 php 的 salesforce 沙箱连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15245097/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com