# ACTIVESTATE TEAPOT-PKG BEGIN TM -*- tcl -*- # -- Tcl Module # @@ Meta Begin # Package WS::Wub 1.3.0 # Meta as::author {Gerald W. Lester} # Meta as::build::date 2011-03-17 # Meta as::origin http://tclws.googlecode.com/ # Meta category Web Services # Meta description # Meta license BSD # Meta platform tcl # Meta require Debug # Meta require Direct # Meta require OO # Meta require WS::Server # Meta subject {web service} service WSDL # Meta summary Web Services For Tcl, Server-Side # @@ Meta End # ACTIVESTATE TEAPOT-PKG BEGIN REQUIREMENTS package require Debug package require Direct package require OO package require WS::Server # ACTIVESTATE TEAPOT-PKG END REQUIREMENTS # ACTIVESTATE TEAPOT-PKG BEGIN DECLARE package provide WS::Wub 1.3.0 # ACTIVESTATE TEAPOT-PKG END DECLARE # ACTIVESTATE TEAPOT-PKG END TM # WSWub - Wub interface to WebServices package require WS::Server package require OO package require Direct package require Debug Debug off wsdl 10 package provide WS::Wub 1.3.0 package provide Wsdl 1.0 class create Wsdl { method / {r args} { return [Http Ok $r [::WS::Server::generateInfo $service 0] text/html] } method /op {r args} { if {[catch {::WS::Server::callOp $service 0 [dict get $r -entity]} result]} { return [Http Ok $r $result] } else { dict set r -code 500 dict set r content-type text/xml dict set r -content $result return [NoCache $r] } } method /wsdl {r args} { return [Http Ok $r [::WS::Server::GetWsdl $service] text/xml] } mixin Direct ;# Direct mixin maps the URL to invocations of the above methods variable service constructor {args} { set service [dict get $args -service] ;# we need to remember the service name } }