PHP code example of goetas-webservices / salesforce-enterprise-client

1. Go to this page and download the library: Download goetas-webservices/salesforce-enterprise-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

goetas-webservices / salesforce-enterprise-client example snippets




use GoetasWebservices\SoapServices\SoapClient\ClientFactory;
use GoetasWebservices\SoapServices\SoapClient\Builder\SoapContainerBuilder;
use GoetasWebservices\Client\SalesforceEnterprise\SoapContainer;
use GoetasWebservices\Client\SalesforceEnterprise\SoapStubs\Soap;

rFromContainer($container)->build();

// uncomment this when including goetas-webservices/salesforce-enterprise-client via composer
// $serializer = SoapContainerBuilder::createSerializerBuilderFromContainer($container, null, __DIR__ . '/vendor/goetas-webservices/salesforce-enterprise-client')->build();

$metadata = $container->get('goetas_webservices.soap_client.metadata_reader');
$factory = new ClientFactory($metadata, $serializer);

/**
 * @var $client Soap
 */
$client = $factory->getClient('service.wsdl','Soap', 'SforceService');

// Returns standard information relevant to the current user 
$result = $client->getUserInfo(/* put here your params */);

var_dump($result);