Check-in [1610455cee]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed outdated example EchoEmbeddedService. Ticket [0e2728fadd]
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1610455cee0b54484d8aae5e871aafbf275fb737
User & Date: oehhar 2015-11-03 17:42:07.784
References
2015-11-03 17:44 Fixed ticket [0e2728fadd]: File Examples/Echo/EchoEmbeddedService.tcl outdated: uses old proc "ws::embeded::start" plus 3 other changes artifact: af7408648d user: oehhar
Context
2015-11-09 16:17
::WS::Utils::geturl_followRedirects : limit to 5 redirects, plug http package memory leak, add redirect test scripts check-in: a18130bfaf user: oehhar tags: trunk
2015-11-03 17:42
Fixed outdated example EchoEmbeddedService. Ticket [0e2728fadd] check-in: 1610455cee user: oehhar tags: trunk
2015-06-16 17:05
Return http error messages for authentication and server errorrs. Ticket [ea054d339d] check-in: 3647d0b69f user: oehhar tags: trunk
Changes
Unified Diff Show Whitespace Changes Patch
Changes to Examples/Echo/EchoEmbeddedService.tcl.
29
30
31
32
33
34
35

36
37
38
39
40
41
42
43
44
45
##  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT       ##
##  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR  OTHERWISE) ARISING IN       ##
##  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF  ADVISED OF THE         ##
##  POSSIBILITY OF SUCH DAMAGE.                                              ##
##                                                                           ##
###############################################################################


package require WS::Server 2.3.0
package require WS::Utils 2.3.0
package require WS::Embeded 2.3.0

##
## Define the service
##
::WS::Server::Service \
    -service wsEchoExample \
    -description  {Echo Example - Tcl Web Services} \







>
|
|
|







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
##  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT       ##
##  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR  OTHERWISE) ARISING IN       ##
##  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF  ADVISED OF THE         ##
##  POSSIBILITY OF SUCH DAMAGE.                                              ##
##                                                                           ##
###############################################################################

lappend auto_path [file join [file dirname [info script]] ../..]
package require WS::Server
package require WS::Utils
package require WS::Embeded

##
## Define the service
##
::WS::Server::Service \
    -service wsEchoExample \
    -description  {Echo Example - Tcl Web Services} \
79
80
81
82
83
84
85
86
87
88
89
90
91


92
93

    {Echo a string and a timestamp back} {

    set timeStamp [clock format [clock seconds] -format {%Y-%m-%dT%H:%M:%SZ} -gmt yes]
    return [list ComplexEchoResult [list echoBack $TestString echoTS $timeStamp]  ]
}

set ::errorInfo {}
::WS::Embeded::Listen 8015
set ::errorInfo {}

puts stdout {Starting event loop}
flush stdout
::WS::Embeded::Start


puts stdout {Exited event loop}
flush stdout








|


|

|
>
>


>
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    {Echo a string and a timestamp back} {

    set timeStamp [clock format [clock seconds] -format {%Y-%m-%dT%H:%M:%SZ} -gmt yes]
    return [list ComplexEchoResult [list echoBack $TestString echoTS $timeStamp]  ]
}

set ::errorInfo {}
set SocketHandle [::WS::Embeded::Listen 8015]
set ::errorInfo {}

puts stdout {Server started. Press Enter to stop}
flush stdout
fileevent stdin readable {set QuitNow 1}
vwait QuitNow
close $SocketHandle
puts stdout {Exited event loop}
flush stdout