Build the Salesforce SOAP client

@return Client
761751
public function build()
    {
        $soapClientFactory = new SoapClientFactory();
        $soapClient = $soapClientFactory->factory($this->wsdl, $this->soapOptions);

        $client = new Client($soapClient, $this->username, $this->password, $this->token);

        if ($this->log) {
            $logPlugin = new LogPlugin($this->log);
            $client->getEventDispatcher()->addSubscriber($logPlugin);
        }

        return $client;
    }
438430
protected function createLaravelDriver(): Sdk\Client
    {
        return \tap($this->createHttpClient(), function ($client) {
            if (isset($this->config['client_id']) || isset($this->config['client_secret'])) {
                $client->setClientId($this->config['client_id'])
                        ->setClientSecret($this->config['client_secret']);
            }

            if (isset($this->config['access_token'])) {
                $client->setAccessToken($this->config['access_token']);
            }
        });
    }
450160
protected function getClient() {
        if ($this->client === null) {
            $params = [
                'credentials' => [
                    'key' => $this->params['key'],
                    'secret' => $this->params['secret'],
                ],
                'version' => $this->params['version'],
            ];

            if ($this->params['region']) {
                $params['region'] = $this->params['region'];
            }

            $this->client = new S3Client($params);
        }

        return $this->client;
    }
1001621
protected function buildServiceManager()
    {
        // ServiceManager creation
        $serviceManager = new ServiceManagerBuilder($this->getConfigManager()->getMergedConfig());
        $serviceManager->build($this->getAppParameters());
        $serviceManager->set('app', $this);

        return $serviceManager;
    }
301012
private function buildAuthHeader() {
		$auth_params = array(
			'user' => $this->getCredentials()->getUser(),
			'signature' => $this->getCredentials()->getSignature(),
			'type' => 0
		);

		return new SoapHeader(self::DHL_SOAP_HEADER_URI, 'Authentification', $auth_params);
	}
1064743
public function getClient()
    {
        if (null === $this->client) {
            $this->client = S3Client::factory([
                'version'   => 'latest',
                'region'    => $this->getRegion()
            ]);
        }
        return $this->client;
    }
127406
public function build(): JWS
    {
        if (null === $this->payload) {
            throw new \RuntimeException('The payload is not set.');
        }
        if (0 === \count($this->signatures)) {
            throw new \RuntimeException('At least one signature must be set.');
        }

        $encodedPayload = false === $this->isPayloadEncoded ? $this->payload : Base64Url::encode($this->payload);
        $jws = JWS::create($this->payload, $encodedPayload, $this->isPayloadDetached);
        foreach ($this->signatures as $signature) {
            /** @var SignatureAlgorithm $signatureAlgorithm */
            $signatureAlgorithm = $signature['signature_algorithm'];
            /** @var JWK $signatureKey */
            $signatureKey = $signature['signature_key'];
            /** @var array $protectedHeader */
            $protectedHeader = $signature['protected_header'];
            /** @var array $header */
            $header = $signature['header'];
            $encodedProtectedHeader = empty($protectedHeader) ? null : Base64Url::encode($this->jsonConverter->encode($protectedHeader));
            $input = \sprintf('%s.%s', $encodedProtectedHeader, $encodedPayload);
            $s = $signatureAlgorithm->sign($signatureKey, $input);
            $jws = $jws->addSignature($s, $protectedHeader, $encodedProtectedHeader, $header);
        }

        return $jws;
    }
619269
function Salesforce(username, password, token, wsdl) {

    //Required NodeJS libraries
    this.q = require("q");
    this.soap = require("soap");

    //Salesforce access data
    this.username = username;
    this.password = password;
    this.token = token;
    this.wsdl = wsdl || "./node_modules/soap_salesforce/wsdl/enterprise.xml";

    //Other properties
    this.promise; //A promise will be used for returning soapClient after finishing Salesforce login
    this.soapClient; //Salesforce SOAP client instance will be stored here
}
343142
public function getOpenedClient()
    {
        if (!isset($this->openedClient)) {
            $this->openedClient = new ServiceClient();
            $this->openedClient->setApiKey($this->getParameter('apiKey'));

            $newClient = new \Zend\Http\Client(
                null,
                [
                    'adapter'       => 'Zend\Http\Client\Adapter\Socket',
                    'sslverifypeer' => false,
                ]
            );

            $this->openedClient->setHttpClient($newClient);
        }

        return $this->openedClient;
    }
1039827
public function build()
    {
        if (is_null($this->selectFields)) {
            throw new RuntimeException('The `select()` function must be' .
                ' called prior to this function');
        }

        $awql = $this->buildSelectClause();
        $awql = $this->appendWhereClause($awql);
        $awql = $this->appendOrderByClause($awql);

        if (is_null($this->startIndex) && is_null($this->pageSize)) {
            return new ServiceQuery($awql);
        }
        return new ServiceQuery(
            $awql,
            $this->startIndex,
            $this->pageSize
        );
    }
1134449
public SoapServerActionBuilder server(WebServiceServer soapServer) {
		SoapServerActionBuilder serverAction = new SoapServerActionBuilder(action, soapServer)
				.withApplicationContext(applicationContext);
		return serverAction;
	}
1284365
public function getClient()
    {
        return new S3Client([
            'version' => $this->apiVersion,
            'region' => $this->region,
            'credentials' => [
                'key'    => $this->key,
                'secret' => $this->secret,
            ]
        ]);
    }
1074149
private function initSoapClient()
    {
        if (!isset($this->service))
        {
            throw new ClientException("Not set service");
        }

        if ($this->soapClient === null)
        {
            $this->soapClient = new SoapClient($this->service, $this->cert, $this->trace, $this->curlOptions);
        }
    }
440800
public function build(): StartObservingRequest
	{
		$instance = new StartObservingRequest();
		if ($this->service === null) {
			throw new BuilderException('Property [service] is required.');
		}
		$instance->service = $this->service;
		return $instance;
	}
497798
protected function soapClient(array $classMap, $parameters = array())
    {
        $endpoint = $this->client->getEndpoint();

        if ($this->soapClient === null) {
            $extensions = get_loaded_extensions();
            $errors     = array();

            if (!class_exists('SoapClient') || !in_array('soap', $extensions)) {
                $errors[] = 'The PHP SOAP extension doesn\'t seem to be installed. You need to install the PHP SOAP extension. (See: http://www.php.net/manual/en/book.soap.php)';
            }
            if (!in_array('openssl', $extensions)) {
                $errors[] = 'The PHP OpenSSL extension doesn\'t seem to be installed. You need to install PHP with the OpenSSL extension. (See: http://www.php.net/manual/en/book.openssl.php)';
            }
            if (!empty($errors)) {
                die('<p>' . implode("</p>\n<p>", $errors) . '</p>');
            }

            $options = array(
                'classmap' => $classMap,
                'encoding' => 'utf-8', // lets support unicode
                'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // see http://bugs.php.net/bug.php?id=43338
                'trace'    => false, // can be used for debugging
            );

            $wsdlUri = "https://{$endpoint}/wsdl/?service=" . $this->service;
            try {
                $this->soapClient = new \SoapClient($wsdlUri, $options);
            } catch (\SoapFault $sf) {
                throw new \Exception("Unable to connect to endpoint '{$endpoint}'");
            }

            $this->soapClient->__setCookie('login', $this->client->getLogin());
            $this->soapClient->__setCookie('mode', $this->client->getMode());
        }

        $timestamp = time();
        $nonce     = uniqid('', true);

        $this->soapClient->__setCookie('timestamp', $timestamp);
        $this->soapClient->__setCookie('nonce', $nonce);
        $this->soapClient->__setCookie('clientVersion', $this->apiVersion);
        $this->soapClient->__setCookie(
            'signature',
            $this->_urlencode(
                $this->_sign(
                    array_merge(
                        $parameters,
                        array(
                            '__service'   => $this->service,
                            '__hostname'  => $endpoint,
                            '__timestamp' => $timestamp,
                            '__nonce'     => $nonce
                        )
                    )
                )
            )
        );

        return $this->soapClient;
    }
979228
public SoapClientActionBuilder client(WebServiceClient soapClient) {
		SoapClientActionBuilder clientAction = new SoapClientActionBuilder(action, soapClient)
				.withApplicationContext(applicationContext);
		return clientAction;
	}
894532
public function create() {
		$ssoClient = new \Flowpack\SingleSignOn\Client\Domain\Model\SsoClient();
		if ((string)$this->clientServiceBaseUri === '') {
			throw new Exception('Missing Flowpack.SingleSignOn.Client.client.serviceBaseUri setting', 1351075078);
		}
		$ssoClient->setServiceBaseUri($this->clientServiceBaseUri);
		if ((string)$this->clientPublicKeyFingerprint === '') {
			throw new Exception('Missing Flowpack.SingleSignOn.Client.client.publicKeyFingerprint setting', 1351075159);
		}
		$ssoClient->setPublicKeyFingerprint($this->clientPublicKeyFingerprint);
		return $ssoClient;
	}