{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural

\f0\fs24 \cf0 #!/usr/local/bin/tclsh8.5                                                                                                                                                                                                                                                     \
\
package require SOAP\
package require WS::Client 2.2\
package require log\
\
\
proc initializeLogging \{debugmode\} \{\
    ::log::lvChannelForall stderr\
    foreach lev [::log::levels] \{ ::log::lvSuppress $lev 0 \}\
    ::log::lvSuppress debug [expr $debugmode == 0]\
\}\
\
\
proc initializeSoap \{\} \{\
    global apiname\
\
    set baseUri "https://www.airservicesaustralia.com/FIB/flight-info-service"\
    set wsdl [::WS::Client::GetAndParseWsdl "$baseUri?wsdl"]\
    set apiname [::WS::Client::LoadParsedWsdl $wsdl]\
\}\
\
\
proc getFlights \{template\} \{\
    global apiname\
\
    array set result [::WS::Client::DoCall $apiname get-flight-summary [list "get-flight-summary" [list template $template account "my-bogus-username" password "my-bogus-password"]]]\
\}\
\
\
initializeLogging 1\
initializeSoap\
\
getFlights [list "state" [list "state" "COOR CONT HAND SUSP INHB"]]\
exit 0\
\
}