1# silab.tcl - Copyright (C) 2001 Pat Thoyts <Pat.Thoyts@bigfoot.com>
2#
3# Run the SOAP Interoperability Test Suite Round 2: Base tests.
4# Generates a html page of the results.
5#
6# $Id: silab.tcl,v 1.8 2003/01/26 01:57:33 patthoyts Exp $
7
8package require soapinterop::base
9package require soapinterop::B
10package require soapinterop::C
11
12set logdir   {../doc/silab}
13set logcount 0
14set logfile  {}
15
16#      toolkit          endpoint  action   namespace
17# {{Apache 2.1}      http://nagoya.apache.org:5089/soap/servlet/rpcrouter  urn:soapinterop http://soapinterop.org/}
18# {{SOAP.py}         http://208.177.157.221:9595/xmethodsInterop           urn:soapinterop http://soapinterop.org/}
19set round1 {
20    {{TclSOAP 1.6}     http://tclsoap.sourceforge.net/cgi-bin/rpc            urn:soapinterop http://soapinterop.org/}
21    {{SOAP::Lite}      http://services.soaplite.com/interop.cgi              urn:soapinterop http://soapinterop.org/}
22    {{4s4c}            http://soap.4s4c.com/interop/soap.asp                 urn:soapinterop http://soapinterop.org/}
23    {{Frontier 7.0}    http://www.soapware.org/xmethodsInterop              /xmethodsInterop http://soapinterop.org/}
24    {{ActiveState}     http://soaptest.activestate.com:8080/PerlEx/soap.plex urn:soapinterop http://soapinterop.org/}
25    {{Dolphin Harbor}  http://www.dolphinharbor.org/services/interop         urn:soapinterop http://soapinterop.org/}
26    {{EasySoap++}      http://www.xmethods.net/c/easysoap.cgi                urn:soapinterop http://soapinterop.org/}
27    {{eSoapServer}     http://www.connecttel.com/cgi-bin/esoapserver.cgi     urn:soapinterop http://soapinterop.org/}
28}
29
30# round 2 http://www.whitemesa.com/interop.htm
31#{{eSOAP}            http://212.177.97.8:8080/rpcrouter http://soapinterop.org/ http://soapinterop.org/}
32#{{SOAP RMI}         http://www.extreme.indiana.edu:1568  http://soapinterop.org/ http://soapinterop.org/}
33#{{kSOAP 0.8}        http://kissen.cs.uni-dortmind.de:8008               http://soapinterop.org/ http://soapinterop.org/}
34set round2base {
35    {{TclSOAP 1.6}      http://tclsoap.sourceforge.net/cgi-bin/rpc          http://soapinterop.org/ http://soapinterop.org/}
36    {{SOAP::Lite}       http://services.soaplite.com/interop.cgi            http://soapinterop.org/ http://soapinterop.org/}
37    {{ASP.NET}          http://www.mssoapinterop.org/asmx/simple.asmx       http://soapinterop.org/ http://soapinterop.org/}
38    {{MS .NET Remoting} http://www.mssoapinterop.org/remoting/ServiceA.soap http://soapinterop.org/ http://soapinterop.org/}
39    {{Spray}            http://www.dolphinharbor.org/services/interop       http://soapinterop.org/ http://soapinterop.org/}
40    {{SQLData SOAP}     http://soapclient.com/interop/sqldatainterop.wsdl   http://soapinterop.org/ http://soapinterop.org/}
41    {{SOAP4R}           http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInterop/ http://soapinterop.org/ http://soapinterop.org/}
42    {{EasySoap++}       http://easysoap.sourceforge.net/cgi-bin/interopserver       http://soapinterop.org/ http://soapinterop.org/}
43    {{SOAPx4 (PHP) .5}  http://dietrich.ganx4.com/soapx4/soap.php           http://soapinterop.org/ http://soapinterop.org/}
44    {{White Mesa SOAP}  http://www.whitemesa.net/interop/std                http://soapinterop.org/ http://soapinterop.org/ {-encoding SOAP1.2}}
45    {{SIM}              http://soapinterop.simdb.com/round2                 http://soapinterop.org/ http://soapinterop.org/}
46    {{Spray 2001}      http://www.dolphinharbor.org/services/interop2001    http://soapinterop.org/ http://soapinterop.org/ {-encoding SOAP1.2}}
47    {{4s4c}             http://soap.4s4c.com/ilab/soap.asp                  http://soapinterop.org/ http://soapinterop.org/}
48    {{Apache Axis}      http://nagoya.apache.org:5049/axis/servlet/AxisServlet  http://soapinterop.org/ http://soapinterop.org/}
49    {{Apache SOAP}      http://nagoya.apache.org:5049/soap/servlet/rpcrouter    http://soapinterop.org/ http://soapinterop.org/}
50}
51
52set round2B {
53    {{TclSOAP 1.6}      http://tclsoap.sourceforge.net/cgi-bin/rpc          http://soapinterop.org/ http://soapinterop.org/}
54    {{SOAP::Lite}      http://services.soaplite.com/interop.cgi             http://soapinterop.org/ http://soapinterop.org/}
55    {{SOAP4R}          http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInterop/ http://soapinterop.org/ http://soapinterop.org/}
56    {{SIM}             http://soapinterop.simdb.com/round2B                 http://soapinterop.org/ http://soapinterop.org/}
57    {{Spray 2001}      http://www.dolphinharbor.org/services/interopB2001   http://soapinterop.org/ http://soapinterop.org/ {-encoding SOAP1.2}}
58    {{EasySoap++}       http://easysoap.sourceforge.net/cgi-bin/interopserver  http://soapinterop.org/ http://soapinterop.org/}
59    {{White Mesa SOAP}  http://www.whitemesa.net/interop/std/groupB         http://soapinterop.org/ http://soapinterop.org/ {-encoding SOAP1.2}}
60    {{MS .NET Remoting} http://www.mssoapinterop.org/remoting/ServiceB.soap http://soapinterop.org/ http://soapinterop.org/ {-encoding SOAP1.2}}
61    {{MS SOAP Toolkit} http://www.mssoapinterop.org/stk/InteropB.wsdl       http://soapinterop.org/ http://soapinterop.org/ {-encoding SOAP1.2}}
62    {{ASP.NET}          http://www.mssoapinterop.org/asmx/simpleB.asmx      http://soapinterop.org/ http://soapinterop.org/ {-encoding SOAP1.2}}
63    {{4s4c}            http://soap.4s4c.com/ilab/soap.asp                   http://soapinterop.org/ http://soapinterop.org/}
64}
65
66set round2C {
67    {{TclSOAP 1.6}      http://tclsoap.sourceforge.net/cgi-bin/rpc          http://soapinterop.org/ http://soapinterop.org/}
68    {{SOAP::Lite}       http://services.soaplite.com/interopC.cgi              http://soapinterop.org/ http://soapinterop.org/}
69    {{White Mesa SOAP}  http://www.whitemesa.net/interop/std/echohdr           http://soapinterop.org/ http://soapinterop.org/ {-encoding SOAP1.2}}
70    {{EasySoap++}       http://easysoap.sourceforge.net/cgi-bin/interopserver  http://soapinterop.org/ http://soapinterop.org/}
71    {{MS SOAP Toolkit}  http://mssoapinterop.org/stk/InteropC.wsdl             http://soapinterop.org/ http://soapinterop.org/ {-encoding SOAP1.2}}
72    {{Spray 2001}      http://www.dolphinharbor.org/services/interopC          http://soapinterop.org/ http://soapinterop.org/ {-encoding SOAP1.2}}
73    {{ASP.NET}          http://www.mssoapinterop.org/asmx/header.asmx          http://soapinterop.org/ http://soapinterop.org/ {-encoding SOAP1.2}}
74}
75
76# -------------------------------------------------------------------------
77
78proc silab:round1 {} {
79    set title {SILAB Round 1 Tests called from TclSOAP}
80    set info {
81	This page is generated by a Tcl script that uses the TclSOAP client code
82	against a list of SOAP servers implementing the SOAP Interoperability Lab
83	Round 1 service. The results are printed as OK or the error is
84	shown. The raw XML for the reqyest and the reply is available via links in
85	each table. If there is no XML then the error occurred in the TclSOAP client
86	code or the server is down.}
87    set filename "round1.html"
88    silab:execute $filename $title $info $::round1 proposalA
89}
90
91proc silab:round2 {} {
92    set title {SILAB Round 2 Base Tests called via TclSOAP}
93    set info {
94	This page is generated by a Tcl script that uses the TclSOAP client code
95	against a list of SOAP servers implementing the SOAP Interoperability Lab
96	Round 2 proposal A service. The results are printed as OK or the error is
97	shown. The raw XML for the request and the reply is available via links in
98	each table. If there is no XML then the error occurred in the TclSOAP client
99	code or the server is down.}
100    set filename "round2base.html"
101    silab:execute $filename $title $info $::round2base proposalA
102}
103
104# -------------------------------------------------------------------------
105
106proc silab:round2B {} {
107    set title {SILAB Round 2 Proposal B Tests called via TclSOAP}
108    set info {
109	This page is generated by a Tcl script that uses the TclSOAP client code
110	against a list of SOAP servers implementing the SOAP Interoperability Lab
111	Round 2 proposal B service. The results are printed as OK or the error is
112	shown. The raw XML for the request and the reply is available via links in
113	each table. If there is no XML then the error occurred in the TclSOAP client
114	code or the server is down.}
115    set filename "round2B.html"
116    silab:execute $filename $title $info $::round2B proposalB
117}
118
119# -------------------------------------------------------------------------
120
121proc silab:round2C {} {
122    set title {SILAB Round 2 Proposal C Tests called via TclSOAP}
123    set info {
124	This page is generated by a Tcl script that uses the TclSOAP client code
125	against a list of SOAP servers implementing the SOAP Interoperability Lab
126	Round 2 proposal C service. The results are printed as OK or the error is
127	shown. The raw XML for the request and the reply is available via links in
128	each table. If there is no XML then the error occurred in the TclSOAP client
129	code or the server is down.}
130    set filename "round2C.html"
131    silab:execute $filename $title $info $::round2C proposalC
132}
133
134# -------------------------------------------------------------------------
135
136# procname - procedure to execute to perform the tests.
137
138proc silab:execute {filename title info servers procname} {
139    global logdir
140    global logfile
141
142    # set a global http timeout to avoid overruns of 30 seconds
143    SOAP::configure -transport http -timeout 30000
144
145    if {$logdir != {} && ![file isdirectory $logdir]} {
146	file mkdir $logdir
147    }
148    if {$filename != {}} {
149        set logfile [open [file join $logdir $filename] w]
150    } else {
151        set logfile stdout
152    }
153
154    puts $logfile "<!doctype HTML public \"-//W3O//DTD W3 HTML 2.0//EN\">\
155	    <html><head><link href=\"../tclsoap.css\" rel=\"stylesheet\" type=\"text/css\">\
156            <title>$title</title></head>"
157    puts $logfile {
158<body>
159<table class="globaltable">
160  <tr><td class="header" width="15%">
161     <a href="http://sourceforge.net/">
162        <img align="middle" alt="SourceForge Logo" border="0" height="31" width="88"
163             src="http://sourceforge.net/sflogo.php?group_id=25970"></a>
164 </td>
165 <td class="header" width="70%">
166    }
167    puts $logfile "<h1>$title</h1>"
168    puts $logfile {
169      </td>
170      <td class="logo" width="15%">
171        <img src="../tclsoap.gif" alt="TclSOAP Logo" align="middle"
172        border="0" height="84" width="57" />
173      </td>
174  </tr>
175
176  <tr><td class="sidebar">
177    <table>
178      <tr><td class="sidehead">Results</td></tr>
179    }
180
181    # Draw the sidebar stuff
182    foreach server $servers {
183	puts $logfile "<tr><td class=\"sideelt\"><a href=\"#[lindex $server 0]\">[lindex $server 0]</a></td></tr>"
184    }
185
186    puts $logfile {
187<tr><td class="sidehead">Project</td></tr>
188<tr><td class="sideelt"><a href="http://sourceforge.net/projects/tclsoap">Project Page</a></td></tr>
189<tr><td class="sideelt"><a href="http://sourceforge.net/project/showfiles.php?group_id=25970">File Releases</a></td></tr>
190<tr><td class="sideelt"><a href="../TclSOAP.html">WebPage</a></td></tr>
191<tr><td class="sideelt"><a href="http://sourceforge.net/docman/?group_id=25970">Documentation</a></td></tr>
192<tr><td class="sideelt"><a href="http://sourceforge.net/forum/?group_id=25970">Forums</a></td></tr>
193<tr><td class="sideelt"><a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tclsoap/tclsoap">Browse CVS</a></td></tr>
194<tr><td class="sidehead">Interop</td></tr>
195<tr><td class="sideelt"><a href="round1.html">Round 1 Tests</a></td></tr>
196<tr><td class="sideelt"><a href="round2base.html">Round 2 Base</a></td></tr>
197<tr><td class="sideelt"><a href="round2B.html">Round 2B</a></td></tr>
198<tr><td class="sideelt"><a href="round2C.html">Round 2C</a></td></tr>
199<tr><td class="sidehead">Support</td></tr>
200<tr><td class="sideelt"><a href="http://sourceforge.net/tracker/?aid=385859&group_id=25970&func=browse">Bugs</a></td></tr>
201<tr><td class="sideelt"><a href="http://sourceforge.net/tracker/?aid=385860&group_id=25970&func=browse">Support Requests</a></td></tr>
202<tr><td class="sideelt"><A href="http://sourceforge.net/tracker/?aid=385861&group_id=25970&func=browse">Patches</a></td></tr>
203<tr><td class="sideelt"><A href="http://sourceforge.net/tracker/?aid=385862&group_id=25970&func=browse">Feature Requests</a></td></tr>
204    </table>
205  </td>
206  <td class="body" colspan="2">
207  <div class="body">
208    }
209
210    puts $logfile "<p>$info</p><hr>"
211    flush $logfile
212
213    foreach server $servers {
214	if {[catch {eval $procname \
215			[list [lindex $server 0]] \
216                        [list [lindex $server 1]] \
217                        [list [lindex $server 2]] \
218                        [list [lindex $server 3]] \
219                        [lindex $server 4] \
220                    } msg ]} {
221	    puts $logfile "<font color=\"red\">\
222                    <h3>An Error occurred processing [lindex $server 0]</h3>\
223		    <p>$msg</p></font>"
224	}
225	flush $logfile
226    }
227
228    puts $logfile {
229</div>
230</td></tr>
231<tr class="footer">
232<td class="footer" colspan="3">
233    }
234    puts $logfile "Last Updated: [clock format [clock seconds]]"
235    puts $logfile {
236</td></tr>
237
238    </table>
239  </body>
240</html>
241    }
242
243    close $logfile
244}
245
246# -------------------------------------------------------------------------
247# Description:
248#  Setup and run the base SOAP Interop Lab Client tests.
249#
250proc proposalA {toolkit where action xmlns args} {
251    global logfile
252
253    set soapinterop::uri $xmlns
254    set soapinterop::action $action
255    eval soapinterop::create:base [list $where] $args
256
257    puts $logfile "<h2><a name=\"$toolkit\">$toolkit $where</a></h2>\n<table>\n"
258
259    perform $toolkit soapinterop::validate.echoVoid
260    perform $toolkit soapinterop::validate.echoDate
261    perform $toolkit soapinterop::validate.echoBase64
262    perform $toolkit soapinterop::validate.echoInteger
263    perform $toolkit soapinterop::validate.echoFloat
264    perform $toolkit soapinterop::validate.echoString
265    perform $toolkit soapinterop::validate.echoIntegerArray
266    perform $toolkit soapinterop::validate.echoFloatArray
267    perform $toolkit soapinterop::validate.echoStringArray
268    perform $toolkit soapinterop::validate.echoStruct
269    perform $toolkit soapinterop::validate.echoStructArray
270
271    puts $logfile "</table><hr>\n\n"
272    return {}
273}
274
275# -------------------------------------------------------------------------
276# Description:
277#  Setup and run the base SOAP Interop Lab Client proposal B tests.
278#
279proc proposalB {toolkit where action xmlns args} {
280    global logfile
281
282    set soapinterop::uri $xmlns
283    set soapinterop::action $action
284    eval soapinterop::create:proposalB [list $where] $args
285
286    puts $logfile "<h2><a name=\"$toolkit\">$toolkit $where</a></h2>\n<table>\n"
287
288    perform $toolkit soapinterop::validate.echoStructAsSimpleTypes
289    perform $toolkit soapinterop::validate.echoSimpleTypesAsStruct
290    perform $toolkit soapinterop::validate.echoNestedArray
291    perform $toolkit soapinterop::validate.echoNestedStruct
292    perform $toolkit soapinterop::validate.echo2DStringArray
293
294    puts $logfile "</table><hr>\n\n"
295    return {}
296}
297
298# -------------------------------------------------------------------------
299# Description:
300#  Setup and run the Round 2 Proposal C tests (found in soapinteropC.tcl)
301#
302proc proposalC {toolkit where action xmlns args} {
303    global logfile
304
305    eval SOAP::create soapinterop::echoVoid \
306        -name echoVoid \
307	-proxy  [list $where] \
308        -uri    [list $xmlns] \
309        -action [list $action] $args
310
311    puts $logfile "<h2><a name=\"$toolkit\">$toolkit $where</a></h2>\n<table>\n"
312
313    perform $toolkit soapinterop::validate.emsr:A echoVoid propc
314    perform $toolkit soapinterop::validate.emsr:B echoVoid propc
315    perform $toolkit soapinterop::validate.emsr:C echoVoid propc
316    perform $toolkit soapinterop::validate.emsr:D echoVoid propc
317    perform $toolkit soapinterop::validate.emsr:E echoVoid propc
318    perform $toolkit soapinterop::validate.emsr:F echoVoid propc
319    perform $toolkit soapinterop::validate.emtr:A echoVoid propc
320    perform $toolkit soapinterop::validate.emtr:B echoVoid propc
321    perform $toolkit soapinterop::validate.emtr:C echoVoid propc
322    perform $toolkit soapinterop::validate.emtr:D echoVoid propc
323    perform $toolkit soapinterop::validate.emtr:E echoVoid propc
324    perform $toolkit soapinterop::validate.emtr:F echoVoid propc
325
326    puts $logfile "</table><hr>\n\n"
327    return {}
328}
329
330# -------------------------------------------------------------------------
331# Description:
332#  Perform a SOAP call. Capture the request and reply XML packets and save
333#  to unique files under `logdir'. Appends a suitable log message to the
334#  `logfile'
335#
336proc perform {toolkit procname {methodname {}} {prefix dump}} {
337    global logfile
338    global logdir
339    global logcount
340
341    set name [lindex [split $procname .] end]
342    if {$methodname != {}} {set name $methodname}
343    set failed [catch [list $procname] msg]
344    if {$failed} {
345	set msg [string map {< &lt; > &gt; & &amp;} $msg]
346	set msg "<font color=\"red\">$msg</font>"
347    } else {
348	set msg ok
349    }
350
351    puts $logfile "<tr><td>$name</td><td>$msg</td>"
352
353    if {$logdir != {}} {
354        set request [file join $logdir "${prefix}${logcount}.xml"]
355        incr logcount
356        set reply   [file join $logdir "${prefix}${logcount}.xml"]
357        incr logcount
358
359        set err [catch {SOAP::dump -req soapinterop::$name} xml]
360        set f [open $request w]
361        puts -nonewline $f $xml
362        close $f
363
364        catch {SOAP::dump soapinterop::$name} xml
365        set f [open $reply w]
366        puts -nonewline $f $xml
367        close $f
368
369        puts $logfile "<td><a href=\"[file tail $request]\">request</a></td>\
370	               <td><a href=\"[file tail $reply]\">reply</a></td></tr>"
371    }
372}
373
374# Should we go ahead and run this...
375if {!$::tcl_interactive} {
376    set logdir   [file join [pwd] interop-results]
377    silab:round1
378    silab:round2
379    silab:round2B
380    silab:round2C
381}
382