false, 'message' => "E01: Authentication is required for this webservice."); } else if ($amda_ws->getNewToken()['token'] != $_GET["token"]) { $result = array('success' => false, 'message' => "E02: Token expired. Please authenticate again."); } else { $result = $amda_ws->getDataset($_GET); } if ($result['success']) { $file = str_replace("http://oberoi.cesr.fr/AMDA-WS/", BASE_PATH, $result['dataFileURLs']); if ($file) { // header('Content-type: text/xml'); // $contenu = file_get_contents($file); // error_log($contenu,3,'/home/natacha/TMP/tmp.xml'); // echo $contenu; header('Content-type: text/xml'); $doc = new DOMDocument(); $doc->load($file); echo $doc->saveXML(); } } else { $success = "false"; echo ''; echo '' . $success . ''; echo '' . $result['message'] . ''; } ?>