extra: import at 3.0.1 beta 1
[mozilla-extra.git] / extensions / webservices / soap / tests / soapunscramble.html
blobc36eb8067eca9e405f1a29eb0de1a9fa4743b41a
1 <HTML>
2 <HEAD>
3 </HEAD>
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>
22 <SCRIPT>
24 var unscrambler = new Unscramble();
25 var currentword;
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');
31 if (list != null) {
32 list.parentNode.removeChild(list);
34 list = document.createElement("UL");
35 list.id = "LIST";
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)
48 return;
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);
63 </SCRIPT>
64 <P>
65 <FORM>
67 <SELECT ID=LANGUAGE SIZE="1" name="RequestName">
68 </SELECT>
69 <INPUT ID=WORD TYPE="text" ONKEYUP="unscramble(document.getElementById('LANGUAGE').value,document.getElementById('WORD').value);">
70 </BODY>
71 </HTML>