Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Client aanroepen
- $client = new SoapClient('http://test.trekhaken.nl/ws/trekhaken.php?WSDL');
- //Inloggen en Token verkrijgen
- $username = "****"; //hardcoded - removed for obvious reasons
- $password = "****"; //hardcoded - removed for obvious reasons
- $token = $client->Authentication($username,$password);
- //Check if server is alive
- try{
- $ping = $client->Ping();
- if ($ping != "Pong!") {echo "De server van onze leverancier is offline. Neem even <a href='https://www.potgieter.nl/contact'>contact</a> op, of probeer het later nog eens.";}
- }
- catch(SoapFault $ex){var_dump($ex2);
- }
- //producten ophalen met kenteken
- try {
- if (isset ($_COOKIE["kentekenCookie"])){
- $kenteken = $_COOKIE["kentekenCookie"];
- #echo for testing purposes only
- #echo $kenteken;
- $producten = $client->GetProductsByLicensePlate($token, $kenteken);
- $products = "=" . json_encode($producten);
- $accessoires = $client->GetAccessoires($token);
- $accessories = "=" . json_encode($accessoires);
- }
- }
- catch(SoapFault $ex){var_dump($ex2);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement