I'm new to Salesforce PhP toolkit and need help with below issues
When I try to submit attachment (to my personal document in Salesforce) from Home/external Internet connect, the script is working as expected.
However when I try to post the same attachment file from office/F5 network, I see
"Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host, SforceBaseClient.php on line 167".
Tried defining the Proxy settings @ ProxySettings.php (that I use in office) but no luck...
Used below code snippet and tried to post an attachment, I see error message as "too few parameters", am I missing something here?
$mySforceConnection = new SforceEnterpriseClient();
$mySforceConnection->createConnection("soapclient/enterprise.wsdl.xml");
$mySforceConnection->login(SF_USERNAME, SF_PASSWORD.SF_SECURITY_TOKEN);
// Create Document record
$document = new stdclass();
$document->Name = $_FILES['fileToUpload']['name'];
$document->type = 'Attachment';
$document->PARENTID = '5002XXXXXXXXXX';
//$document->FolderId = '012CXXXXXXXX'; // CHANGE THIS TO YOUR FOLDER ID!!!
$document->Description = 'Upload of '.$_FILES['fileToUpload']['name'];
$document->Body = base64_encode(file_get_contents($_FILES['fileToUpload']
['tmp_name']));
//$response = $mySforceConnection->create(array($document), 'Document');
$response = $mySforceConnection->create(array($document));
Yes, you have:
But should be:
It thinks the SF_Password.SF_Security_Token is all one but it is two separate things. This is how it has worked for me in the past. I could be wrong though, worth a try.