iframe header
  • Join FlightAware (Why Join?)
  • Login
  • US Flag 
10:13PM EDT

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Help a Noob out
PostPosted: Mon Jan 02, 2012 3:19 am 
Offline

Joined: Thu Dec 29, 2011 10:02 am
Posts: 10
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.

Code:
<?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


Top
 Profile  
 
 Post subject: Re: Help a Noob out
PostPosted: Tue Jan 03, 2012 12:00 pm 
Offline
FlightAware Staff
bovineone - FlightAware user avatar

Joined: Wed Jul 27, 2005 3:00 am
Posts: 234
Location: FlightAware WHQ
Make sure that in this line you are using a hexadecimal FlightXML API Key that was obtained from http://flightaware.com/commercial/flightxml/key and not just your website password:

Code:
$apiKey = 'password';


Most users find it easier and quicker to simply sign up for a normal paid FlightXML API Key (and adding a credit card to your account, if you haven't already added one). There is no signup fee or minimum commitment, and we don't make a billing attempt to your credit card until after you've accrued more than $5 of usage, which usually means several hundreds (or possibly thousands) of API requests. If you never reach that usage threshold and decide to not use our API anymore, no charge will be made. If you feel that you still require a free key, you can contact us and we can try to work out an arrangement for a time-limited trial account.


Top
 Profile  
 
 Post subject: Re: Help a Noob out
PostPosted: Wed Jan 04, 2012 10:11 am 
Offline

Joined: Thu Dec 29, 2011 10:02 am
Posts: 10
Thanks B
Will give it a shot then


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
iframe sidebar


 

Airport Tracker/Info


-or-