1 |
<?php |
2 |
/** |
3 |
* Serveur de test SOAP pour elyxweb. |
4 |
* Les fonctions attendues sont : |
5 |
* - getExistParcelle ; |
6 |
* - getCalculEmprise ; |
7 |
* - getContrainteNRU et |
8 |
* - getCentroideDossier. |
9 |
*/ |
10 |
class SigElyxTest { |
11 |
|
12 |
|
13 |
/** |
14 |
* Constructeur |
15 |
*/ |
16 |
function __construct(){ |
17 |
|
18 |
include_once('../core/om_logger.class.php'); |
19 |
//Pour des besoins de log il faut set $_SERVER["REQUEST_URI"] |
20 |
if (!isset($_SERVER["REQUEST_URI"])) { |
21 |
$_SERVER["REQUEST_URI"] = __FILE__; |
22 |
} |
23 |
} |
24 |
|
25 |
/** |
26 |
* Retourne l'adresse de la parcelle |
27 |
* @param string $wParcelle |
28 |
* |
29 |
* @return array l'adresse |
30 |
*/ |
31 |
public function getExistParcelle($wParcelle = NULL){ |
32 |
|
33 |
$ret = "ORA-01403: aucune donnée trouvée"; |
34 |
|
35 |
if ($wParcelle!=""&&!is_null($wParcelle)){ |
36 |
$ret = array( |
37 |
"return" => array( |
38 |
"arrdt"=> "11", |
39 |
"dnuvoi"=> "0075", |
40 |
"existe"=> "0", |
41 |
"id"=> "211866 C0034", |
42 |
"nom"=> "DE LA DOMINIQUE", |
43 |
"prefixe"=> "TRA", |
44 |
) |
45 |
); |
46 |
} |
47 |
|
48 |
return $ret; |
49 |
} |
50 |
|
51 |
/** |
52 |
* Calcule l'emprise |
53 |
* @param string $wParcelle |
54 |
* @param string $wId |
55 |
* |
56 |
* @return array le résultat |
57 |
*/ |
58 |
public function getCalculEmprise($wParcelle = NULL, $wId = NULL){ |
59 |
|
60 |
$ret = array( |
61 |
"return"=> "0", |
62 |
); |
63 |
|
64 |
return $ret; |
65 |
} |
66 |
|
67 |
/** |
68 |
* récupère les contraintes |
69 |
* @param string $wType |
70 |
* @param string $wId |
71 |
* |
72 |
* @return array La liste des contraintes |
73 |
*/ |
74 |
public function getContrainteNRU($object = NULL){ |
75 |
|
76 |
// |
77 |
$ret = array( |
78 |
"return" => array( |
79 |
array( |
80 |
"groupe"=> "ZONES DU PLU", |
81 |
"idContrainte"=> "6", |
82 |
"libelle"=> "Une contrainte du PLU", |
83 |
"ssgroupe"=> "protection", |
84 |
), |
85 |
array( |
86 |
"groupe"=> "ZONES DU PLU", |
87 |
"idContrainte"=> "26", |
88 |
"libelle"=> "Une seconde contrainte du PLU", |
89 |
"ssgroupe"=> "protection", |
90 |
) |
91 |
) |
92 |
); |
93 |
|
94 |
return $ret; |
95 |
} |
96 |
|
97 |
/** |
98 |
* Calcul le centroide du dossier |
99 |
* @param string $wId |
100 |
* @param string $wRef |
101 |
* |
102 |
* @return array les corrdonnées du centroide |
103 |
*/ |
104 |
public function getCentroideDossier($wId = NULL, $wRef = NULL){ |
105 |
|
106 |
$ret = array( |
107 |
"return" => array( |
108 |
"coordX"=> "122", |
109 |
"coordY"=> "223", |
110 |
"dossierID"=> "DP0130551200001P0", |
111 |
) |
112 |
); |
113 |
|
114 |
return $ret; |
115 |
} |
116 |
} |
117 |
|
118 |
|
119 |
//Désactive la mise en cache du WSDL |
120 |
ini_set("soap.wsdl_cache_enabled","0"); |
121 |
|
122 |
//Création d'un nouveau serveur |
123 |
$server = new SoapServer("wsurbanisme.wsdl"); |
124 |
|
125 |
//Ajout des fonctions au serveur |
126 |
$server->setClass('SigElyxTest'); |
127 |
|
128 |
//Traitement de la requête SOAP |
129 |
$server->handle(); |
130 |
|
131 |
?> |