• qwerty
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
Is there any way to determine the number of API calls that have been made per day?

We are adding various features that increase our use of the API and I would like to know how close to the daily maximum we are without logging calls locally.
  • January 25, 2007
  • Like
  • 0
Can someone please provide the link to the Version 7 API documentation? I can't find it for the life of me.
  • January 22, 2007
  • Like
  • 0
The toolkit appears to be incorrectly converting SObjects into SoapVars before passing the objects into the PHP-SOAP proxy binding methods for create, upsert, and update. The use of SoapVar objects completely defeats the purpose of WSDL and causes the binding to only serialize the fields element of the SObject. This is why for updates, you must include the Id as a member of the fields array.

Is there any reason why I should not simply pass the SObjects directly into the binding (ie remove the SoapVar instantiation)?

The reason this came up is because the current implementation makes it impossible to include fieldsToNull, as it is not a member of fields.
  • January 05, 2007
  • Like
  • 0
I would post this to the Sourceforge bug forums but they appear dead.

Bug: Specifying an MruHeader will cause a specified AssignmentRuleHeader not to be used.

The bug has to do with the wtf way the toolkit adds headers to the request. It removes all headers before adding a specific one. Thus, the second call to add the MruHeader removes the previously added AssignmentRuleHeader.

I would submit a patch but I have no idea what the intended behavior is for reusing headers. Here would be my guess as the easiest way to fix this bug:

public function create($sObjects, $assignment_header=NULL, $mru_header=NULL) {
$arg = new stdClass;
$sObjectsArray = array();
foreach ($sObjects as $record) {
$soapvar = new SoapVar($record->fields, SOAP_ENC_OBJECT, $record->type, 'http://soapinterop.org/xsd');
array_push($sObjectsArray, $soapvar);
}
$arg->sObjects = $sObjectsArray;

$headers = array();
$headers[] = new SoapHeader($this->namespace, 'SessionHeader', array ('sessionId' => $this->sessionId));

if ($assignment_header != NULL) {
$headers[] = new SoapHeader($this->namespace,
'AssignmentRuleHeader',
array('assignmentRuleId'=>$assignment_header->assignmentRuleId,'useDefaultRule'=>$assignment_header->useDefaultRuleFlag));
}
if ($mru_header != NULL) {
$headers[] = new SoapHeader($this->namespace,'MruHeader',array('updateMru'=>$mru_header->updateMruFlag));
}

$this->sforce->__setSoapHeaders($headers);
return $this->sforce->create($arg)->result;
}


Rinse and repeat for update().
  • December 21, 2006
  • Like
  • 0
Hello, can anyone help me with this?

This code is not working very well...

until the second "Try" everything works well....
but, when I get to the query it doesn't even print the "NOT REACHING THIS PRINT!", print...

can anyone help me with this please?

<?php
 
require_once ('C:\Program Files\PHP\ext\soapclient\SforcePartnerClient.php');

try
{
    $mySforceConnection = new SforcePartnerClient();
    $mySoapClient = $mySforceConnection->createConnection("partner.wsdl.xml");
    $mylogin = $mySforceConnection->login("admin@*****.com", "******");
 
      print "Reaching this print";  
 
      $userResult = $mylogin->userInfo;
      print $userResult->userFullName.', your session id is '.$mylogin->sessionId;

}
catch (Exception $e)
{
  echo $e->faultstring;
}

try
{
   // $result = $sforce->query(array("queryString" => "select Id, FirstName, LastName from Lead where Lead.FirstName='Miguel'"));
   // print_r($result);
   $query =  "select Id from Lead where Lead.FirstName='Miguel'";
   $result = $sforce->query($query);
   print_r($result);
   print "NOT REACHING THIS PRINT!";

} catch (Exception $e)
{
    print_r($e);
}
?>
  • June 13, 2007
  • Like
  • 0
Hi
 
I am getting this [HTTP] Could not connect to host  error. Is that the indication that salesforce API  is down?
 
Is there a way we can figure out if the API is down at any time?
 
-DG
Can someone please provide the link to the Version 7 API documentation? I can't find it for the life of me.
  • January 22, 2007
  • Like
  • 0