PHP code example of goetas-webservices / dhl-express-track-client
1. Go to this page and download the library: Download goetas-webservices/dhl-express-track-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 / dhl-express-track-client example snippets
use GoetasWebservices\SoapServices\SoapClient\ClientFactory;
use GoetasWebservices\SoapServices\SoapClient\Builder\SoapContainerBuilder;
use GoetasWebservices\Client\DHLExpressTrack\SoapContainer;
use GoetasWebservices\Client\DHLExpressTrack\SoapStubs\GblDHLExpressTrack;
tainer($container)->build();
// uncomment this when including goetas-webservices/dhl-express-track-client via composer
// $serializer = SoapContainerBuilder::createSerializerBuilderFromContainer($container, null, __DIR__ . '/vendor/goetas-webservices/dhl-express-track-client')->build();
$metadata = $container->get('goetas_webservices.soap_client.metadata_reader');
$factory = new ClientFactory($metadata, $serializer);
/**
* @var $client GblDHLExpressTrack
*/
$client = $factory->getClient('https://wsb.dhl.com/gbl/glDHLExpressTrack?WSDL','gblDHLExpressTrack', 'gblDHLExpressTrack');
$result = $client->trackShipmentRequest(/* put here your params */);
var_dump($result);