Advertisement
Guest User

Untitled

a guest
Sep 4th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. <?php
  2. //Client aanroepen
  3. $client = new SoapClient('http://test.trekhaken.nl/ws/trekhaken.php?WSDL');
  4.  
  5. //Inloggen en Token verkrijgen
  6. $username = "****"; //hardcoded - removed for obvious reasons
  7. $password = "****"; //hardcoded - removed for obvious reasons
  8. $token = $client->Authentication($username,$password);
  9.  
  10. //Check if server is alive
  11. try{
  12. $ping = $client->Ping();
  13. 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.";}
  14. }
  15. catch(SoapFault $ex){var_dump($ex2);
  16. }
  17.  
  18. //producten ophalen met kenteken
  19. try {
  20. if (isset ($_COOKIE["kentekenCookie"])){
  21. $kenteken = $_COOKIE["kentekenCookie"];
  22. #echo for testing purposes only
  23. #echo $kenteken;
  24.  
  25. $producten = $client->GetProductsByLicensePlate($token, $kenteken);
  26. $products = "=" . json_encode($producten);
  27.  
  28. $accessoires = $client->GetAccessoires($token);
  29. $accessories = "=" . json_encode($accessoires);
  30.  
  31. }
  32.  
  33. }
  34. catch(SoapFault $ex){var_dump($ex2);
  35. }
  36.  
  37.  
  38.  
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement