test.php 1.5 KB

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