Advertisement
Guest User

WDSL - client

a guest
Aug 29th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.25 KB | None | 0 0
  1. <?php
  2. // Pull in the NuSOAP code
  3. require_once('nusoap.php');
  4. // Create the client instance
  5.  
  6. // Create object
  7. $client = new nusoap_client('<slettet>server.php');
  8.  
  9. // Check for an error
  10. $err = $client->getError();
  11. if ($err) {
  12.     // Display the error
  13.     echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
  14.     // At this point, you know the call that follows will fail
  15. }
  16. // Call the SOAP method
  17. $medlemsnummer = array('142319', '142617',"7","1003");
  18. $result = $client->call('HentStamdata',array('medlemsnummer' => $medlemsnummer),'',"http://tempuri.org/hello");
  19.  
  20. // Check for a fault
  21.  
  22. if ($client->fault) {
  23.     echo '<h2>Fault</h2><pre>';
  24.     print_r($result);
  25.     echo '</pre>';
  26. } else {
  27.     // Check for errors
  28.     $err = $client->getError();
  29.     if ($err) {
  30.         // Display the error
  31.         echo '<h2>Error</h2><pre>' . $err . '</pre>';
  32.     } else {
  33.         // Display the result
  34.         echo '<h2>Result</h2><pre>';
  35.         print_r($result);
  36.     echo '</pre>';
  37.     }
  38. }
  39. ?>
  40. <?php
  41. // Display the request and response
  42.  
  43. echo '<h2>Request</h2>';
  44. echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
  45. echo '<h2>Response</h2>';
  46. echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
  47.  
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement