|
Page Created :
CXF20DOC :
_javascript_ClientSamples
_javascript_ClientSamples has been created by Benson Margulies (Dec 14, 2007). Content:So far, there is one sample in the distribution. This sample, called js_browser_client_simple, provides an HTML user interface to the tiny hello_world service also present in the wsdl_first sample. <!-- Generate and retrieve a _javascript_ client for the server. --> <script type="text/_javascript_" src="" class="code-quote">"/SoapContext/SoapPort?js"></script> <script type="text/_javascript_"> <!-- create an object that talks to the Greeter service. --> var Greeter = new apache_org_hello_world_soap_http_Greeter(); <!-- set the URL for the service. No cross-scripting allowed. --> Greeter.url = "" class="code-quote">"/SoapContext/SoapPort"; var responseSpan; <!-- This is the function called upon success. --> function sayHiResponse(response) { responseSpan.firstChild.nodeValue = response.getResponseType(); } <!-- This is the function called for an error. --> function sayHiError(error) { alert('error ' + error); } <!-- This function is invoked from the button press to run the service. --> function invokeSayHi() { responseSpan = document.getElementById('sayHiResponse'); responseSpan.firstChild.nodeValue = " - pending - "; Greeter.sayHi(sayHiResponse, sayHiError); } </script> </head> <body> <h1> Hello World Sample </h1> <form> <div> <table> <tr> <td>Run sayHi</td> <td><input type="button" value="invoke" name="sayHi" class="code-quote">"invokeSayHi()"> </tr> <tr> <td>sayHi response</td> <td><span id='sayHiResponse'>- not yet invoked -</span></td> </tr> </table> </div> </form> </body> </html> |
Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request
Unsubscribe or edit your notifications preferences
Unsubscribe or edit your notifications preferences
