$reqSelect],'WSI2_STAT_Label.php'); $resConn=$idPdo->query($reqSelect); if ($resConn) { $res=$resConn->fetch(PDO::FETCH_ASSOC); $MR_WebSiteId=$res['idCompte']; $MR_WebSiteKey=$res['pwdCompte']; if (isset($debug[2]) && $debug[2] == '1' ) {echo '
secret= ' .$secret;} } require_once ('nusoap-0.9.6/lib/nusoap.php'); // $ = $compte; // $ = $secret; $client = new nusoap_client("http://api.mondialrelay.com/Web_Services.asmx?WSDL", true); $client->soap_defencoding = 'utf-8'; // param SOAP $params = array( 'Enseigne' => $MR_WebSiteId, 'STAT' => $MR_WebSiteId, 'Langue' => "Fr", ); // 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( 'WSI2_STAT_Labels', $params, 'https://api.mondialrelay.com/', 'https://api.mondialrelay.com/WSI2_STAT_Labels' ); // 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 . '
'; } } // pour debug echo '
'.print_r($result). '
'; // echo '_SESSION[idPointRelais]=' .$_SESSION['idPointRelais']; $PRelais=$result; $myVar=""; // flag traduction EDT // $myVar='Liste des points relais'; $a=0; 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"; $trouve=false; $myVar .= ''; if ($key2!==0 && $value2!=='') { if (strpos( $key2, "LgAdr1")!==false) { $myVar .= "• $value2 \n
"; $trouve=true; } if ($value2=='FR') $value2='FRANCE'; // Pas besoin de libellés de champs if (strpos( $key2, "LgAdr3")!==false || strpos( $key2, "LgAdr2")!==false || strpos( $key2, "LgAdr4")!==false|| strpos( $key2, "Pays")!==false) { $myVar .= ''; $myVar .= "" .$value2. "\n
"; $myVar .= '
'; $trouve=true; } // CP pas de
: collé avec ville if (strpos( $key2, "CP")!==false) { $myVar .= ''; $myVar .= "" .$value2; $myVar .= ''; $trouve=true; } // Espace avant pour ville if (strpos( $key2, "Ville")!==false) { $myVar .= ''; $myVar .= " " .$value2. "\n
"; $myVar .= '
'; $trouve=true; } // Si horraire on affichera en 7 if (strpos( $key2, "Horaires")!==false) { $myVar .= " "; $trouve=true; } // affiche les autres champs if ($trouve==false) { // $myVar .= "$key2 : $value2 \n
"; } // $aff=1; } $trouve=false; $aff=0; $myVar .= '
'; } } echo '' .$myVar. ''; // echo '

Request

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

Response

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

Debug

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