test.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. require_once '../inc/lib/nusoap/nusoap.php';
  3. require_once '../inc/conf/configuration.php';
  4. ?>
  5. <html>
  6. <body>
  7. <div class="results">
  8. <?php
  9. $server = $_configuration['root_web'].'main/webservices/';
  10. $serversys = $_configuration['root_sys'].'main/webservices/';
  11. //$script = 'registration.soap.php';
  12. $script = $_POST['script'];
  13. $contact= $server.$script.'?wsdl';
  14. $client = new nusoap_client($contact);
  15. $err = $client->getError();
  16. if ($err) {
  17. // Display the error
  18. echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
  19. // At this point, you know the call that follows will fail
  20. }
  21. $response = array();
  22. if (!empty($_POST['function'])) {
  23. $response = $client->call($_POST['function']);
  24. echo '<pre>#';
  25. print_r($response);
  26. echo '#</pre>';
  27. }
  28. $list = scandir($serversys);
  29. $scripts = array();
  30. foreach ($list as $item) {
  31. if (substr($item,0,1) == '.') { continue; }
  32. if (substr($item,-8)=='soap.php') {
  33. $scripts[] = $item;
  34. }
  35. }
  36. ?>
  37. </div>
  38. <form method="POST" action="">
  39. <label for="script">Script</label>
  40. <select name="script">
  41. <?php
  42. foreach ($scripts as $script) {
  43. echo '<option value="'.$script.'">'.$script.'</script>';
  44. }
  45. ?>
  46. </select><br />
  47. <label for="function">Function</label>
  48. <input type="text" name="function" value="<?php echo $_POST['function'];?>"></input><br />
  49. <label for="param[0]">Param 0</label>
  50. <input type="text" name="param[0]" value="<?php echo $_POST['param'][0];?>"></input><br />
  51. <input type="submit" name="submit" value="Send"/>
  52. </form>