1 |
vpihour |
2164 |
<?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 |
fmichon |
2238 |
|
33 |
vpihour |
2169 |
$ret = "ORA-01403: aucune donnée trouvée"; |
34 |
softime |
2200 |
|
35 |
vpihour |
2169 |
if ($wParcelle!=""&&!is_null($wParcelle)){ |
36 |
|
|
$ret = array( |
37 |
|
|
"return" => array( |
38 |
|
|
"arrdt"=> "11", |
39 |
softime |
2200 |
"dnuvoi"=> "0075", |
40 |
|
|
"existe"=> "0", |
41 |
vpihour |
2169 |
"id"=> "211866 C0034", |
42 |
|
|
"nom"=> "DE LA DOMINIQUE", |
43 |
|
|
"prefixe"=> "TRA", |
44 |
|
|
) |
45 |
|
|
); |
46 |
|
|
} |
47 |
vpihour |
2164 |
|
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 |
fmichon |
2238 |
|
60 |
vpihour |
2164 |
$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 |
vpihour |
2782 |
public function getContrainteNRU($object = NULL){ |
75 |
|
|
|
76 |
softime |
2812 |
// |
77 |
|
|
$ret = array( |
78 |
|
|
"return" => array( |
79 |
|
|
array( |
80 |
vpihour |
2782 |
"groupe"=> "ZONES DU PLU", |
81 |
|
|
"idContrainte"=> "6", |
82 |
|
|
"libelle"=> "Une contrainte du PLU", |
83 |
|
|
"ssgroupe"=> "protection", |
84 |
|
|
), |
85 |
softime |
2812 |
array( |
86 |
|
|
"groupe"=> "ZONES DU PLU", |
87 |
|
|
"idContrainte"=> "26", |
88 |
|
|
"libelle"=> "Une seconde contrainte du PLU", |
89 |
|
|
"ssgroupe"=> "protection", |
90 |
vpihour |
2782 |
) |
91 |
softime |
2812 |
) |
92 |
|
|
); |
93 |
vpihour |
2782 |
|
94 |
vpihour |
2164 |
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 |
fmichon |
2238 |
|
106 |
vpihour |
2164 |
$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 |
|
|
?> |