goetas-webservices/dhl-express-track-client

1.0.0 2018-11-16 10:39 UTC

This package is auto-updated.

Last update: 2024-10-17 00:36:04 UTC


README

This project provides a SOAP client for the DHL express tracking service

Installing

The recommended way to install goetas-webservices/dhl-express-track-client is using Composer, just run:

composer require goetas-webservices/dhl-express-track-client

Features

  • Pure PHP, no dependencies on ext-soap
  • Complete IDE type hinting support
  • PSR-7 HTTP messaging compatible
  • Multi HTTP client (guzzle, buzz, curl, react)
  • No WSDL/XSD parsing on production
  • Extensible (event listeners support)

Usage

<?php

use GoetasWebservices\SoapServices\SoapClient\ClientFactory;
use GoetasWebservices\SoapServices\SoapClient\Builder\SoapContainerBuilder;
use GoetasWebservices\Client\DHLExpressTrack\SoapContainer;
use GoetasWebservices\Client\DHLExpressTrack\SoapStubs\GblDHLExpressTrack;

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/dhl-express-track-client via composer
$serializer = SoapContainerBuilder::createSerializerBuilderFromContainer($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);

Note

The code in this project is provided under the MIT license. For professional support contact goetas@gmail.com or visit https://www.goetas.com