itop.wsdl.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // Copyright (C) 2010 Combodo SARL
  3. //
  4. // This program is free software; you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation; version 3 of the License.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program; if not, write to the Free Software
  15. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. /**
  17. * Dynamic generation of the WSDL file for SOAP Web services
  18. *
  19. * @author Erwan Taloc <erwan.taloc@combodo.com>
  20. * @author Romain Quetiez <romain.quetiez@combodo.com>
  21. * @author Denis Flaven <denis.flaven@combodo.com>
  22. * @license http://www.opensource.org/licenses/gpl-3.0.html LGPL
  23. */
  24. // This is to make sure that the client will accept it....
  25. //
  26. header('Content-Type: application/xml; charset=UTF-8');
  27. //header('Content-Disposition: attachment; filename="itop.wsdl"');
  28. header('Content-Disposition: online; filename="itop.wsdl"');
  29. $sMyWsdl = './itop.wsdl.tpl';
  30. $sRawFile = file_get_contents($sMyWsdl);
  31. $sServerURI = 'http'.(empty($_SERVER['HTTPS']) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/soapserver.php';
  32. $sFinalFile = str_replace(
  33. '___SOAP_SERVER_URI___',
  34. $sServerURI,
  35. $sRawFile
  36. );
  37. echo $sFinalFile;
  38. ?>