You need to sign in to do that
Don't have an account?
TheBomb
PHP CLI not working?
I have written some code to select some custom objects in php from a web page and thought I might use the same code to perform the same operation using cli php...but it doesn't work. For some reason, the query returns a SOAP error message without any message in it! Maybe this is a SOAP issue.
I'm using nusoap/debian/php/linux and a developement sforce application while I am prototyping some functionality.
Sample code is:
require_once("SalesforceClient.php");
$client = new SalesforceClient();
$result = $client->login(XXX,YYY);
if (PEAR::isError($result)) {
$errors = "Error: " . $result->getMessage() . "\n";
} else {
$client = new SalesforceClient($result->sessionId);
$client->_endpoint = $_COOKIE['sf_endpoint'];
$query_str = "select Description, CaseNumber from case ";
$results = $client->query($query_str);
# print_r($result);
if (PEAR::isError($results)) {
print "\n----ERROR\n".$results->getMessage()."\n";
print "$query_str\n\n";
exit;
} else {
foreach ($results as $result) {
print_r($result);
}
}
}
?>
I'm using nusoap/debian/php/linux and a developement sforce application while I am prototyping some functionality.
Sample code is:
require_once("SalesforceClient.php");
$client = new SalesforceClient();
$result = $client->login(XXX,YYY);
if (PEAR::isError($result)) {
$errors = "Error: " . $result->getMessage() . "\n";
} else {
$client = new SalesforceClient($result->sessionId);
$client->_endpoint = $_COOKIE['sf_endpoint'];
$query_str = "select Description, CaseNumber from case ";
$results = $client->query($query_str);
# print_r($result);
if (PEAR::isError($results)) {
print "\n----ERROR\n".$results->getMessage()."\n";
print "$query_str\n\n";
exit;
} else {
foreach ($results as $result) {
print_r($result);
}
}
}
?>
$client->_endpoint = $_COOKIE['sf_endpoint'];
which should read
$client->_endpoint = $result->serverUrl;
Serves me right for copying and pasting from an example without understanding.