4 <BODY onload=loadLanguages()
>
5 <H1>SOAP Test: Unscramble
</H1>
6 The entered word will be unscrambled against a dictionary.
7 <p>This works by calling a SOAP service. View the source
8 of this page for details on how it was called. If you compile mozilla DEBUG,
9 the message sent and received will be logged to the console. This loads js files
10 <a href=soapunscrambleproxy.js
>soapunscrambleproxy.js
</a> which relies on
11 <a href=soapproxy.js
>soapproxy.js
</a>, which implement a SOAP proxy on top
12 of the low level SOAP API in Mozilla. In a future version of Mozilla, it
13 should be possible to construct SOAP proxies directly from the wsdl file.
14 <p>Since this service is friendly to untrusted applets, it may be
15 called without requesting additional privileges from the user.
16 <p>Other services are available on the
17 <A href=
"http://www.xmethods.com">X Methods Website
</A>.
18 Experimenters may wish to create other tests which exercize services, with
19 specific user interfaces.
20 <script src=soapproxy.js
></script>
21 <script src=soapunscrambleproxy.js
></script>
24 var unscrambler = new Unscramble();
27 // Passed in as the response handler in the asynchronous case
28 // and called directly (see below) in the synchronous case
29 function receiveunscramblings(unscramblings) {
30 var list = document.getElementById('LIST');
32 list.parentNode.removeChild(list);
34 list = document.createElement(
"UL");
36 if (unscramblings != null) {
37 for (i =
0; i < unscramblings.length; i++) {
38 var item = document.createElement(
"LI");
39 item.appendChild(document.createTextNode(unscramblings[i]));
40 list.appendChild(item);
43 document.getElementById('WORD').parentNode.appendChild(list);
46 function unscramble(language,word) {
47 if (language + word == currentword)
49 currentword = language + word;
50 unscrambler.unscramble(language, word, receiveunscramblings);
53 function loadLanguages()
55 var list = unscrambler.languages();
56 for (i =
0; i < list.length; i++) {
57 var option = document.createElement(
"option");
58 option.value = list[i];
59 option.text = list[i];
60 document.getElementById('LANGUAGE').add(option,null);
67 <SELECT ID=LANGUAGE
SIZE=
"1" name=
"RequestName">
69 <INPUT ID=WORD
TYPE=
"text" ONKEYUP=
"unscramble(document.getElementById('LANGUAGE').value,document.getElementById('WORD').value);">