soapserver.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * SOAP-based web service
  4. *
  5. * @package iTopORM
  6. * @author Romain Quetiez <romainquetiez@yahoo.fr>
  7. * @author Denis Flaven <denisflave@free.fr>
  8. * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
  9. * @link www.itop.com
  10. * @since 1.0
  11. * @version 1.1.1.1 $
  12. */
  13. // Important note: if some required includes are missing, this might result
  14. // in the error "looks like we got no XML document"...
  15. require_once('../application/application.inc.php');
  16. require_once('../application/startup.inc.php');
  17. require('./webservices.class.inc.php');
  18. // pb ? - login_web_page::DoLogin(); // Check user rights and prompt if needed
  19. // Main program
  20. $oSoapServer = new SoapServer(
  21. null,
  22. //"http://localhost:81/trunk/webservices/Itop.wsdl", // to be a file generated dynamically with location = here
  23. array(
  24. 'uri' => 'http://test-itop/',
  25. // note: using the classmap and no WSDL spec causes a fault in APACHE (looks like an infinite loop)
  26. //'classmap' => array('ItopErrorSOAP' => 'ItopError')
  27. )
  28. );
  29. // $oSoapServer->setPersistence(SOAP_PERSISTENCE_SESSION);
  30. $oSoapServer->setClass('WebServices', null);
  31. if ($_SERVER["REQUEST_METHOD"] == "POST")
  32. {
  33. $oSoapServer->handle();
  34. }
  35. else
  36. {
  37. echo "This SOAP server can handle the following functions: ";
  38. $aFunctions = $oSoapServer->getFunctions();
  39. echo "<ul>\n";
  40. foreach($aFunctions as $sFunc)
  41. {
  42. echo "<li>$sFunc</li>\n";
  43. }
  44. echo "</ul>\n";
  45. echo "";
  46. }
  47. ?>