Last active
February 1, 2021 15:14
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
oh gott endlich mal die lösung zu dem scheiss gefunden... DANKE!