When trying to generate a soap access token for salsforce I am getting an error:
Fatal error: Call to a member function __setSoapHeaders() on a non-object in D:\XAMPP\htdocs\test24\soapclient\SforceBaseClient.php on line 158
I'm not sure how to solve this.
require ('config.php'); ini_set('soap.wsdl_cache_enabled', 0); ini_set('soap.wsdl_cache_ttl', 0); //Create a new Salesforce Partner object $connection = new SforcePartnerClient(); //Create the SOAP connection to Salesforce try { $connection->createConnection(salesforce_wsdl); } catch (Exception $e) { //Salesforce could be down, or you have an error in configuration //Check your WSDL path //Otherwise, handle this exception } //Pass login details to Salesforce try { $connection->login(salesforce_username, salesforce_password.salesforce_token); } catch (Exception $e) { //Make sure your username and password is correct //Otherwise, handle this exception } //Describing the Leads object and printing the array $describe = $connection->describeSObjects(array('Lead')); print_r($describe); //Create New Lead $leadFirstName = "Ahmed"; $leadLastName = "Dirie"; $leadCompany = "Pick Yours Up"; $leadEmail = "adirie@pickyoursup.com"; //Creating the Lead Object $lead = new stdClass; $lead->type = 'Lead'; $lead->fields = array( 'FirstName' => $leadFirstName, 'LastName' => $leadLastName, 'Company' => $leadCompany, 'Email' => $leadEmail ); //Submitting the Lead to Salesforce $result = $connection->create(array($lead), 'Lead'); ?>