Skip to content

Instantly share code, notes, and snippets.

@seriousManual
Last active February 1, 2021 15:14
Show Gist options
  • Save seriousManual/6dc28df4b63b273ce782 to your computer and use it in GitHub Desktop.
Save seriousManual/6dc28df4b63b273ce782 to your computer and use it in GitHub Desktop.
Minimal code example for a SOAP call to the DHL API (Packstations search)
<?php
$userName = 'fooUser';
$password = 'fooPassword';
$endpoint = 'https://cig.dhl.de/services/sandbox/soap';
$client = new SoapClient("https://cig.dhl.de/cig-wsdls/com/dpdhl/wsdl/standortsuche-api/1.0/standortsuche-api-1.0.wsdl", [
'login' => $userName,
'password' => $password,
'location' => $endpoint,
'soap_version' => SOAP_1_1
]);
$address = new stdClass();
$address->zip = '12487';
$call = new stdClass();
$call->key = '';
$call->address = $address;
$getPackstationsByAddrResponse = $client->__soapCall('getPackstationsByAddress', [$call]);
$packstations = $getPackstationsByAddrResponse->packstation;
@mjddp
Copy link

mjddp commented Sep 18, 2018

oh gott endlich mal die lösung zu dem scheiss gefunden... DANKE!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment