Artifact [64ff045c7f]
Not logged in
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA

Artifact 64ff045c7f9b8d396c5991eac3a5c0847ccf108d:

Attachment "example.tcl.rtf" to ticket [51f6196783] added by bovine 2012-02-22 20:46:30.
{\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\
\
}