/**
  * Intercept the soapServer method call in order to handle the call thrue the process method
  * Return php variables, the soap server will transform it in a soap response
  */
 public function processSoap()
 {
     $this->wsdl = new jWSDL($this->request->params['module'], $this->request->params['action']);
     $this->soapServer = $this->getSoapServer($this->wsdl);
     $this->soapServer->setclass('jSoapHandler', $this);
     $this->soapServer->handle($this->request->soapMsg);
 }
 /**
  * Traitement par défaut
  */
 public function processDefault()
 {
     // On charge la classe exportée
     Copix::RequireOnce($this->_exportClassFilename);
     // Définition du serveur Soap
     if (isset($this->_wsname)) {
         $server = new SoapServer(_url('wsserver|default|wsdl', array('wsname' => $this->_wsname)));
     } else {
         $server = new SoapServer(_url('wsserver|default|wsdl'));
     }
     // Assignation de la classe exportée au serveur
     $server->setclass($this->_exportClass);
     // Traitement des appels
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $server->handle();
         return _arNone();
     } else {
         $res = '<strong>' . _i18n('wsserver.handle.title') . '</strong>';
         $res .= '<ul>';
         foreach ($server->getFunctions() as $func) {
             $res .= '<li>' . $func . '</li>';
         }
         $res .= '</ul>';
         $res;
     }
     $tpl = new CopixTpl();
     $tpl->assign('MAIN', $res);
     return new CopixActionReturn(CopixActionReturn::DISPLAY, $tpl);
 }
@package   Webservices
@author    Nelly Mahu-Lasson
@copyright Copyright (c) 2009-2014 Webservices plugin team
@license   AGPL License 3.0 or (at your option) any later version
           http://www.gnu.org/licenses/agpl-3.0-standalone.html
@link      https://forge.indepnet.net/projects/webservices
@link      http://www.glpi-project.org/
@since     2009
--------------------------------------------------------------------------
*/
if (!extension_loaded("soap")) {
    header("HTTP/1.0 500 Extension soap not loaded");
    die("Extension soap not loaded");
}
ini_set("soap.wsdl_cache_enabled", "0");
define('DO_NOT_CHECK_HTTP_REFERER', 1);
include "../../inc/includes.php";
Plugin::load('webservices', true);
Plugin::doHook("webservices");
plugin_webservices_registerMethods();
error_reporting(E_ALL);
try {
    $server = new SoapServer(null, array('uri' => ''));
    $server->setclass('PluginWebservicesSoap');
} catch (Exception $e) {
    echo $e;
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $server->handle();
}