iframe header
  • Join FlightAware (Why Join?)
  • Login
  • US Flag 
02:12AM EDT

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: AirportInfo with ICAO starting with '0' (zero)
PostPosted: Tue Sep 08, 2009 5:42 pm 
Offline

Joined: Sat Sep 05, 2009 4:00 pm
Posts: 2
Calling AirportInfo in PHP 5.2.6 with the built-in SOAP class for airports whose ICAO code starts with a zero results in the following var_dump:

Code:

object(SoapFault)#8 (9) {
  ["message:protected"]=>
  string(55) "can't read "::airportTZ(06N)": no such element in array"
  ["string:private"]=>
  string(0) ""
  ["code:protected"]=>
  int(0)
  ["file:protected"]=>
  string(48) "/usr/local/apache2/htdocs/thunberg/air/index.php"
  ["line:protected"]=>
  int(11)
  ["trace:private"]=>
  array(2) {
    [0]=>
    array(4) {
      ["function"]=>
      string(6) "__call"
      ["class"]=>
      string(10) "SoapClient"
      ["type"]=>
      string(2) "->"
      ["args"]=>
      array(2) {
        [0]=>
        string(11) "AirportInfo"
        [1]=>
        array(1) {
          [0]=>
          string(3) "06N"
        }
      }
    }
    [1]=>
    array(6) {
      ["file"]=>
      string(48) "/usr/local/apache2/htdocs/thunberg/air/index.php"
      ["line"]=>
      int(11)
      ["function"]=>
      string(11) "AirportInfo"
      ["class"]=>
      string(10) "SoapClient"
      ["type"]=>
      string(2) "->"
      ["args"]=>
      array(1) {
        [0]=>
        string(3) "06N"
      }
    }
  }
  ["faultstring"]=>
  string(55) "can't read "::airportTZ(06N)": no such element in array"
  ["faultcode"]=>
  string(4) "NONE"
  ["detail"]=>
  object(stdClass)#6 (1) {
    ["errorInfo"]=>
    object(stdClass)#7 (2) {
      ["errorCode"]=>
      string(4) "NONE"
      ["stackTrace"]=>
      string(488) "can't read "::airportTZ(06N)": no such element in array
    while executing
"list name $name location $location longitude $longitude latitude $latitude timezone $::airportTZ($airportCode)"
    (procedure "AirportInfo" line 12)
    invoked from within
"AirportInfo 06N"
    (in namespace inscope "::FlightAwareDirectFlight" script line 1)
    invoked from within
"::namespace inscope ::FlightAwareDirectFlight AirportInfo 06N"
    invoked from within
"interp eval $interp $fqdn $argValues""
    }
  }
}


The above error is different than the "airport doesn't exist" error so it's not a matter of an obscure airport -- seems to be a bug with var types / array indices.

If you're confident this is a bug on PHP's end I'll go ahead and file it with them -- let me know.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 17, 2009 5:25 pm 
Offline
mduell - FlightAware user avatar

Joined: Wed Jul 27, 2005 3:00 pm
Posts: 4715
Location: FAWHQ
That's a bug on our part when we don't have a timezone for the airport you requested.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 17, 2009 5:32 pm 
Offline

Joined: Sat Sep 05, 2009 4:00 pm
Posts: 2
Thank you for the reply and clarification. I figured a way around it by creating a db of 100k+ fixes based on data from http://www.navaid.com (which in turn gets data from https://www1.nga.mil/ProductsServices/A ... fault.aspx) so thanks for saving me a few fractions of a penny per flightxml query I guess 8)


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-