-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.php
30 lines (21 loc) · 1.25 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
use GoetasWebservices\SoapServices\SoapClient\ClientFactory;
use GoetasWebservices\SoapServices\SoapClient\Builder\SoapContainerBuilder;
use GoetasWebservices\Client\SalesforceEnterprise\SoapContainer;
use GoetasWebservices\Client\SalesforceEnterprise\SoapStubs\Soap;
require __DIR__ . '/vendor/autoload.php';
// project initialization
$container = new SoapContainer();
// use this when cloning this repository and keeping the directory, comment it when including goetas-webservices/salesforce-enterprise-client via composer
$serializer = SoapContainerBuilder::createSerializerBuilderFromContainer($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);