1. Go to this page and download the library: Download itk-dev/serviceplatformen 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/ */
itk-dev / serviceplatformen example snippets
tkDev\Serviceplatformen\Certificate\FilesystemCertificateLocator;
use ItkDev\Serviceplatformen\Request\InvocationContextRequestGenerator;
use ItkDev\Serviceplatformen\Service\PersonBaseDataExtendedService;
$certificateLocator = new FilesystemCertificateLocator(__DIR__.'path_to_certificate.pem', 'passphrase if any');
$pathToWsdl = __DIR__.'/resources/person-base-data-extended-service-contract/wsdl/context/PersonBaseDataExtendedService.wsdl';
$options = [
'local_cert' => $certificateLocator->getAbsolutePathToCertificate(),
'passphrase' => $certificateLocator->getPassphrase(),
'location' => 'https://url.to.service.endpoint'
];
$soapClient = new SoapClient($pathToWsdl, $options);
$requestGenerator = new InvocationContextRequestGenerator(
'xxxx', // Service agreement UUID
'xxxx', // User system UUID
'xxxx', // Service UUID
'xxxx' // User UUID
);
$service = new PersonBaseDataExtendedService($soapClient, $requestGenerator);
$response = $service->personLookup('1234567891');
var_dump($response);
tkDev\AzureKeyVault\Authorisation\VaultToken;
use ItkDev\AzureKeyVault\KeyVault\VaultSecret;
use ItkDev\Serviceplatformen\Certificate\AzureKeyVaultCertificateLocator;
use ItkDev\Serviceplatformen\Request\InvocationContextRequestGenerator;
use ItkDev\Serviceplatformen\Service\PersonBaseDataExtendedService;
$vaultToken = new VaultToken(
$httpClient, // PSR-18 compatible http client
$requestFactory // PSR-17 compatible request factory
);
$token = $vaultToken->getToken(
'xxxx', // Azure tenant id
'xxxx', // Client id (azure application id)
'xxxx' // Client secret
);
$vault = new VaultSecret(
$httpClient, // PSR-18 compatible http client
$requestFactory, // PSR-17 compatible request factory
'testVault', // Name of vault
$token->getAccessToken()
);
$certificateLocator = new AzureKeyVaultCertificateLocator(
$vault,
'xxxx', // Name of the certificate
'xxxx', // Version of the certificate
'yyyy' // optional passphrase for the certificate
);
$pathToWsdl = __DIR__.'/resources/person-base-data-extended-service-contract/wsdl/context/PersonBaseDataExtendedService.wsdl';
$options = [
'local_cert' => $certificateLocator->getAbsolutePathToCertificate(),
'passphrase' => $certificateLocator->getPassphrase(),
'location' => 'https://url.to.service.endpoint'
];
$soapClient = new SoapClient($pathToWsdl, $options);
$requestGenerator = new InvocationContextRequestGenerator(
'xxxx', // Service agreement UUID
'xxxx', // User system UUID
'xxxx', // Service UUID
'xxxx' // User UUID
);
$service = new PersonBaseDataExtendedService($soapClient, $requestGenerator);
$response = $service->personLookup('1234567891');
var_dump($response);