/[openfoncier]/trunk/tests/sig_elyx_test.php
ViewVC logotype

Contents of /trunk/tests/sig_elyx_test.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2782 - (show annotations)
Tue Mar 4 10:12:50 2014 UTC (10 years, 11 months ago) by vpihour
File size: 3658 byte(s)
Correction du script de récupération des contraintes

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 //On récupère des contraintes sur un DI
77 if ( $object->wType == "1" ) {
78 $ret = array(
79 "return" => array(
80 "groupe"=> "ZONES DU PLU",
81 "idContrainte"=> "6",
82 "libelle"=> "Une contrainte du PLU",
83 "ssgroupe"=> "protection",
84 ),
85 );
86 }
87 //On synchronise les contraintes
88 elseif ($object->wType == "2" ) {
89 $ret = array(
90 "return" => array(
91 array(
92 "groupe"=> "ZONES DU PLU",
93 "idContrainte"=> "6",
94 "libelle"=> "Une contrainte du PLU",
95 "ssgroupe"=> "protection",
96 ),
97 array(
98 "groupe"=> "ZONES DU PLU",
99 "idContrainte"=> "26",
100 "libelle"=> "Une seconde contrainte du PLU",
101 "ssgroupe"=> "protection",
102 )
103 )
104 );
105 }
106
107 return $ret;
108 }
109
110 /**
111 * Calcul le centroide du dossier
112 * @param string $wId
113 * @param string $wRef
114 *
115 * @return array les corrdonnées du centroide
116 */
117 public function getCentroideDossier($wId = NULL, $wRef = NULL){
118
119 $ret = array(
120 "return" => array(
121 "coordX"=> "122",
122 "coordY"=> "223",
123 "dossierID"=> "DP0130551200001P0",
124 )
125 );
126
127 return $ret;
128 }
129 }
130
131
132 //Désactive la mise en cache du WSDL
133 ini_set("soap.wsdl_cache_enabled","0");
134
135 //Création d'un nouveau serveur
136 $server = new SoapServer("wsurbanisme.wsdl");
137
138 //Ajout des fonctions au serveur
139 $server->setClass('SigElyxTest');
140
141 //Traitement de la requête SOAP
142 $server->handle();
143
144 ?>

Properties

Name Value
svn:executable *
svn:keywords Id

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26