webservice/application/controllers/IndexController.php

50 lines
1.3 KiB
PHP

<?php
class IndexController extends Zend_Controller_Action
{
protected $appConfig;
public function init()
{
/* Initialize action controller here */
}
public function preDispatch()
{
$auth = Zend_Auth::getInstance();
if (!$auth->hasIdentity()){
$this->_redirect('/user/login');
} else {
$bootstrap = $this->getInvokeArg('bootstrap');
$this->appConfig = $bootstrap->getOptions();
}
}
public function indexAction()
{
require_once 'Web/WebClassDoc.php';
// Gestion des types
$typeConfig = $this->appConfig['classmap']['WsEntreprise']['Type'];
$classmap = array();
foreach ( $typeConfig as $type ){
$classmap[$type] = $type;
}
$doc = new WebClassDoc('WsEntreprise', $classmap);
$tabServiceMethods = $doc->getServiceMethods();
$tabServiceTypes = $doc->getServiceTypes();
$this->view->assign('serviceMethods', $tabServiceMethods);
$this->view->assign('serviceTypes', $tabServiceTypes);
}
public function testAction()
{
//Connexion au service - Faire comme ci on charger le WSDL de l'extérieur
//getFunctions / getTypes
//Pour chaque Function, identifier les Types puis proposer les champs associés
//Valider les formulaires pour executer la requête du service
//Utiliser le jeux de tests disponible
}
}