jcramalho

Cliente do serviço de aritmética

Dec 2nd, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <?php
  2. // Pull in the NuSOAP code
  3. require_once('../nusoap/lib/nusoap.php');
  4.  
  5. // Create the client instance
  6. // Server Location
  7. $location = 'http://epl.di.uminho.pt/jcrbin/WebServices/nusoap-0.9.5/Soma2nums/serv-arit.php';
  8.  
  9. $client = new nusoap_client($location, false);
  10.  
  11. // Call the SOAP method
  12. $n1 = $_REQUEST['n1'];
  13. $n2 = $_REQUEST['n2'];
  14. $op = $_REQUEST['op'];
  15. $result = $client->call($op, array('n1' => $n1, 'n2' => $n2 ));
  16.  
  17. // Display the result
  18. print_r($result);
  19.  
  20. // Display the request and response
  21. echo '<h2>Request</h2>';
  22. echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
  23. echo '<h2>Response</h2>';
  24. echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
  25.  
  26. // Display the debug messages
  27. echo '<h2>Debug</h2>';
  28. echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment