Trac #56 - Implemented and usable but still not a complete and dynamically generated WSDL file. Unit tests are in place (through client/server SOAP protocol, or directly onto the internal API)

SVN:trunk[209]
This commit is contained in:
Romain Quetiez
2009-12-28 11:22:54 +00:00
parent 002c1bf869
commit d8269cc11b
5 changed files with 552 additions and 17 deletions

View File

@@ -0,0 +1,56 @@
<?php
/**
* SOAP-based web service
*
* @package iTopORM
* @author Romain Quetiez <romainquetiez@yahoo.fr>
* @author Denis Flaven <denisflave@free.fr>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.itop.com
* @since 1.0
* @version 1.1.1.1 $
*/
// Important note: if some required includes are missing, this might result
// in the error "looks like we got no XML document"...
require_once('../application/application.inc.php');
require_once('../application/startup.inc.php');
require('./webservices.class.inc.php');
// pb ? - login_web_page::DoLogin(); // Check user rights and prompt if needed
// Main program
$oSoapServer = new SoapServer(
null,
//"http://localhost:81/trunk/webservices/Itop.wsdl", // to be a file generated dynamically with location = here
array(
'uri' => 'http://test-itop/',
// note: using the classmap and no WSDL spec causes a fault in APACHE (looks like an infinite loop)
//'classmap' => array('ItopErrorSOAP' => 'ItopError')
)
);
// $oSoapServer->setPersistence(SOAP_PERSISTENCE_SESSION);
$oSoapServer->setClass('WebServices', null);
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$oSoapServer->handle();
}
else
{
echo "This SOAP server can handle the following functions: ";
$aFunctions = $oSoapServer->getFunctions();
echo "<ul>\n";
foreach($aFunctions as $sFunc)
{
echo "<li>$sFunc</li>\n";
}
echo "</ul>\n";
echo "";
}
?>