$identification */ //login $identification = array ( 'utilisateur' => 'username', //User 'motDePasse' => 'password' //Password ); //Making the final array $balance = array ( 'identification' => $identification ); /** XML-RPC **/ //vars $RpcType = array ( 'dureeVie' => 'int', 'nbLicence' => 'int', 'keySize' => 'int', 'typeDemande' => 'int', 'civiliteAdm' => 'int', 'civiliteTech' => 'int', 'civiliteRespLegal' => 'int' ); $rpcValues = array(); //Functions //Converts our arrays into RPC-ready data, uses recursivity for structures. function tab2rpc($tab) { $tabReturn = false; if ($tab && is_array($tab)) { $tabReturn = array(); while (list($key,$val) = each($tab)) { if ($val && is_array($val)) { $tabReturn[$key]=new xmlrpcval(tab2rpc($val), "struct"); }else{ if (isset($RpcType[$key])) $type = $RpcType[$key]; else $type = "string"; $tabReturn[$key]=new xmlrpcval($val, $type); } } } return $tabReturn; } //Creating the value array $rpcValues = tab2rpc($balance); //Creating the message $message = new xmlrpcmsg('solde'); //This value varies depending on the type of operation $message->addParam(new xmlrpcval($rpcValues,"struct")); //Client configuration $client = new xmlrpc_client($appli, $serveur, $port); $client->setSSLVerifyPeer(false); $client->setSSLVerifyHost(false); $client->setDebug(2); //Sending the request and getting the response $reponse = $client->send($message,0,$transport); $valeur = $reponse->value(); //Trace display if(!$reponse->faultCode()) { $msig = php_xmlrpc_decode($valeur); echo "
".nl2br(print_r($msig,true))."
"; echo '
'; foreach($msig AS $l => $table) echo ''; echo '
'.$l.' '.$table['codeReponse'].' '.$table['messageReponse'].'
'; } else{ echo "Erreur:

Code: ".$reponse->faultCode()."
Message : ".$reponse->faultString()."

"; echo "
reponse :
".print_r($reponse, true)."

\n"; }