1

I have integrated my PHP application with salesforce. I cant retrieve any data from salesforce . I am getting this following error .

org_config.php

<?php

    define("USERNAME", "xxxx@yyyy.com");
define("PASSWORD", "***************");
define("SECURITY_TOKEN", "******************");

?>

Salesforce_SOAP_API_example.php

<html>
<head> <title> Salesforce - PHP Integration using SOAP API </title> </head>
<body>
    <h3>Salesforce - PHP Integration using SOAP API</h3>
    <table>
        <tr>
            <th>Record ID</th>
            <th>First Name</th>
            <th>Last Name</th>
            <th>City</th>
            <th>State</th>
            <th>Country</th>
        </tr>
        <?php   
require_once ('org_config.php'); //configuration file containg login credentials
        require_once ('soapclient/SforcePartnerClient.php');
        $mySforceConnection = new SforcePartnerClient();
        $mySforceConnection->createConnection("D:\Public\xampp\htdocs\SalesforcePhpIntegrationDemo\PartnerWSDL.xml");
        $mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);
        $query = "SELECT Id, FirstName, LastName, Phone from Contact"; //querying data from object
        $response = $mySforceConnection->query($query); //sending request and getting response using SOAP
        foreach ($response->records as $record) //iterating through the response and displaying data
        {   '<tr>
    <td>'.$record->Id.'</td>
    <td>'.$record->fields->FirstName.'</td>
    <td>'.$record->fields->LastName.'</td>
    <td>'.$record->fields->Phone.'</td>
     </tr>'; }?>
    </table>
</body>
</html>

enter image description here

I have added extension=php_openssl.dll this line in php.ini. Still I am getting error...Please help me ....

  • Please update your question with a sample of your source code. SFSE is a resource for solving problems relating to the platform. If you don't provide a discrete use-case and details about where you're stuck, it's not a benefit to the community. – Adam Spriggs Sep 30 '15 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.