soap_defencoding = 'utf-8'; // param SOAP $params = array( 'Enseigne' => $MR_WebSiteId, 'Pays' => "FR", // 'NumPointRelais' => "", 'Ville' => "VENCE", 'CP' => "06140", 'Latitude' => "", 'Longitude' => "", 'Taille' => "", 'Poids' => "", 'Action' => "", 'DelaiEnvoi' => "0", 'RayonRecherche' => "2", // 'TypeActivite' => "", // 'NACE' => "", 'NombreResultats' => "20", ); // On génère la clé de sécurité de l'appel $code = implode("", $params); $code .= $MR_WebSiteKey; $params["Security"] = strtoupper(md5($code)); // l'appel SOAP $result = $client->call( 'WSI3_GetEtiquettes', $params, 'https://api.mondialrelay.com/', 'https://api.mondialrelay.com/WSI3_GetEtiquettes' ); // On vérifie qu'il n'y a pas eu d'erreur if ($client->fault) { echo '

Fault (Expect - The request contains an invalid SOAP body)

';
    print_r($result);
    echo '
'; } else { $err = $client->getError(); if ($err) {echo '

Error

' . $err . '
'; } } // print_r($result); $PRelais=$result; $myVar=""; // flag EDT $myVar="Liste des points relais"; foreach($PRelais as $key => $value) { // $myVar= "\n
1 - $key => $value \n
\n"; // $myVar .= " \n
\n"; foreach( (array)$value as $key2 => $value2) { // $myVar .= "2 - $key2 => $value2 \n
\n"; // $myVar .= " \n
\n"; foreach( (array)$value2 as $key3 => $value3) { // if ($key3!=0) $myVar .= "3 - $key3 => $value3 \n
\n"; // $myVar .= " \n
\n"; foreach( (array)$value3 as $key4 => $value4) { // $myVar .= "\n
4 - $key4 => $value4 \n
\n"; $myVar .= " \n
\n"; // $horraire=0; foreach( (array)$value4 as $key5 => $value5) { $trouve=false; if ($key5!==0 && $value5!=='' && $key5!=='Num' && $key5!=='Distance' &&$key5!=='Localisation1' && $key5!=='Longitude' && $key5!=='Latitude') { if (strpos( $key5, "LgAdr1")!==false) { $myVar .= " Enseigne : $value5 \n
"; $trouve=true; } if ($value5=='FR') $value5='France'; // Pas besoin de libellés de champs if (strpos( $key5, "LgAdr3")!==false || strpos( $key5, "LgAdr2")!==false || strpos( $key5, "LgAdr4")!==false|| strpos( $key5, "Pays")!==false) { $myVar .= "" .$value5. "\n
"; $trouve=true; } // CP pas de
: collé avec ville if (strpos( $key5, "CP")!==false) { $myVar .= "" .$value5; $trouve=true; } // Espace avant pour ville if (strpos( $key5, "Ville")!==false) { $myVar .= " " .$value5. "\n
"; $trouve=true; } // Si horraire on affichera en 7 if (strpos( $key5, "Horaires")!==false) { $myVar .= " "; $trouve=true; } if ($trouve==false) { // $myVar .= "$key5 : $value5 \n
"; } // $aff=1; } $trouve=false; $aff=0; foreach( (array)$value5 as $key6 => $value6) { // if ($key6!==0 && $value6!==''&& $key6!=='string') { // if (!(array)$value6) // $myVar .= "$key6 : " .$value6. " "; // // $horraire=$horraire+1; // $trouve=false; // } $trouve=false; foreach( (array)$value6 as $key7 => $value7) { if ($value7!=='' && $key5!=='Distance' && $key5!=='Num' && $key5!=='Localisation1' && $key5!=='Longitude' && $key5!=='Latitude' && $key5!=='Pays' && $key5!=='Ville' && $key5!=='CP' && $key5!=='LgAdr1' && $key5!=='LgAdr2' && $key5!=='LgAdr3') { $myVar .= ''; if (strpos( $key5, "Horaires") !==false && $trouve==false && $value7!=0 ) { // on enleve le mot Horraire_ $myVar .= "".substr($key5,-(strlen($key5)-9)). " : ".substr($value7,0,2). "H".substr($value7,-2); // on a trouvé au moins 1 horraire $trouve=true; $aff=1; } else { if ($value7!=0) $myVar .= " - ".substr($value7,0,2). "H".substr($value7,-2); } if (empty($value6) && strpos( $key5, "Horaires_Lundi") !==false ) { $myVar .= "" .$key5. " : Fermé "; } $myVar .= ''; } } if ($aff==1) $myVar .= "\n
\n"; } } $myVar .= "
"; } } } } echo '' .$myVar. ''; // echo '

Request

' . nl2br(htmlspecialchars($client->request, ENT_QUOTES)) . ''; // echo '

Request

' . nl2br(htmlspecialchars($client->request, ENT_QUOTES)) . ''; // echo '

Response

' .  nl2br(htmlspecialchars($client->response, ENT_QUOTES)) . '
'; // echo '

Debug

' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '
'; ?>