Hi guys,
Really really new to the whole flightware and FlightXML scenario.
I have been tried to get my hands on the API but failed.
Below is my code.
Well it is exactly the code shown in the site, just replace the user name and password.
<?php
require_once( "nusoap/nusoap.php" );
$username = 'username';
$apiKey = 'password';
$baseUri = "http://flightxml.flightaware.com/soap/FlightXML2";
date_default_timezone_set('UTC');
$client = new nusoap_client("$baseUri/wsdl",'wsdl');
$client->setCredentials($username,$apiKey);
if ( $client->getError() ) {
echo "Soap Constructor Error:" . $client->getError();
exit;
}
// get the weather.
$params = array("airport" => "KAUS");
$result = $client->call( "Metar", $params);
if ($client->fault) { //soap_fault
echo "Soap Fault: ". $client->fault->faultcode . "(" . $client->fault->faultstring . ")";
exit;
}
elseif ( $client->getError() ) {
echo "Soap Error: " . $client->getError();
exit;
}
else {
print_r($result);
}
?>
The issue is that SOAP throws an obvious error “Soap Error: HTTP Error: HTTP authentication failed”.
But the source I got it from keeps on insisting that the credentials are correct.
I am trying this from the local WAMP SERVER which has SOAP dll enabled as well.
Can you please be kind enough to skim through the code to check if there is any error…pretty please
Also, is there a free method to get the username and password without paying, atleast until the development phase is done?
Thanks a million in advance
Cheers
Elabuwa