Advertisement
Guest User

nuSOAP NBRM primer

a guest
Feb 14th, 2011
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.35 KB | None | 0 0
  1. <?php
  2.  
  3. // include the SOAP classes
  4. require_once('lib/nusoap.php');
  5.  
  6.  
  7. $hourdiff = "8"; // hours diff btwn server and local time
  8. $melbdate = date("l, d F Y h:i a",time() + ($hourdiff * 3600));
  9. print ("$melbdate");
  10.  
  11. $today1 = date("d.m.Y",time() + ($hourdiff * 3600));
  12.  
  13. echo $today1;
  14.  
  15. $today = date("d.m.Y");
  16. $thedate= $today1;
  17.  
  18. //$day=date(d);
  19. //$month=date(m);
  20. //$year=date(Y);
  21. //$thedate= $day.".".$month.".".$year;
  22.  
  23. //echo $thedate."<br>";
  24.          
  25.          
  26. $param1=$thedate;
  27. $param2=$thedate;
  28. echo "<br />";
  29. print_r($param1);
  30. echo "<br />";
  31.    
  32. // define parameter array (ISBN number)
  33. $param = array('StartDate'=>$param1, 'EndDate'=>$param2);
  34.    
  35. $endpoint_path = 'http://www.nbrm.mk/klservice/kurs.asmx?WSDL';
  36.    
  37. // define path to server application (the true parameter is absolutely crucial)      
  38. $client = new nusoap_client($endpoint_path, true);
  39.          
  40. // make the call
  41. $result = $client->call('GetExchangeRate', $param);
  42.  
  43.  
  44. foreach ($result as $value) {
  45.     echo '<pre>'.$value.'</pre>';
  46. }
  47.  
  48.  
  49. //echo "REQUEST:\n" . $client->__getLastRequest() . "\n";
  50. echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
  51. echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
  52. echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
  53.  
  54. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement