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

Artifact eae0f63e42a438f0f7e6bf64716dfb2b1cd15af1:

Attachment "example.tcl" to ticket [51f6196783] added by bovine 2012-02-22 20:50:10.
#!/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