cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r678975 - in /cxf/trunk/distribution/src/main/release/samples/js_browser_client_simple: src/demo/hw/server/GreeterImpl.java staticContent/HelloWorld.html
Date Wed, 23 Jul 2008 01:57:23 GMT
Author: bimargulies
Date: Tue Jul 22 18:57:23 2008
New Revision: 678975

URL: http://svn.apache.org/viewvc?rev=678975&view=rev
Log:
Add example of multiple distinct operations in parallel to javascript 
client.

Modified:
    cxf/trunk/distribution/src/main/release/samples/js_browser_client_simple/src/demo/hw/server/GreeterImpl.java
    cxf/trunk/distribution/src/main/release/samples/js_browser_client_simple/staticContent/HelloWorld.html

Modified: cxf/trunk/distribution/src/main/release/samples/js_browser_client_simple/src/demo/hw/server/GreeterImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/js_browser_client_simple/src/demo/hw/server/GreeterImpl.java?rev=678975&r1=678974&r2=678975&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/js_browser_client_simple/src/demo/hw/server/GreeterImpl.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/js_browser_client_simple/src/demo/hw/server/GreeterImpl.java
Tue Jul 22 18:57:23 2008
@@ -29,9 +29,11 @@
                       endpointInterface = "org.apache.hello_world_soap_http.Greeter")
                   
 public class GreeterImpl implements Greeter {
-
+    
     private static final Logger LOG = 
         Logger.getLogger(GreeterImpl.class.getPackage().getName());
+
+    private int sayHiCounter;
     
     /* (non-Javadoc)
      * @see org.apache.hello_world_soap_http.Greeter#greetMe(java.lang.String)
@@ -58,7 +60,7 @@
     public String sayHi() {
         LOG.info("Executing operation sayHi");
         System.out.println("Executing operation sayHi\n");
-        return "Bonjour";
+        return "Bonjour " + (++sayHiCounter);
     }
     
     public void pingMe() throws PingMeFault {

Modified: cxf/trunk/distribution/src/main/release/samples/js_browser_client_simple/staticContent/HelloWorld.html
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/js_browser_client_simple/staticContent/HelloWorld.html?rev=678975&r1=678974&r2=678975&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/js_browser_client_simple/staticContent/HelloWorld.html
(original)
+++ cxf/trunk/distribution/src/main/release/samples/js_browser_client_simple/staticContent/HelloWorld.html
Tue Jul 22 18:57:23 2008
@@ -30,9 +30,9 @@
 var responseSpan;
 
 // This is the function called upon success.
-function sayHiResponse(response)
+function sayHiResponse(response, span)
 {
-    responseSpan.firstChild.nodeValue = response.getResponseType();
+    span.firstChild.nodeValue = response.getResponseType();
 }
 
 // This is the function called for an error.
@@ -45,9 +45,14 @@
 // 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);
+    responseSpan1 = document.getElementById('sayHiResponse1');
+    responseSpan1.firstChild.nodeValue = " - pending - ";
+    responseSpan2 = document.getElementById('sayHiResponse2');
+    responseSpan2.firstChild.nodeValue = " - pending - ";
+    var receiveFirstResponse = function(response) { sayHiResponse(response, responseSpan1);
};
+    Greeter.sayHi(receiveFirstResponse, sayHiError);
+    var receiveSecondResponse = function(response) { sayHiResponse(response, responseSpan2);
};
+    Greeter.sayHi(receiveSecondResponse, sayHiError);
 }
 </script>
 </head>
@@ -65,8 +70,12 @@
 		       onClick="invokeSayHi()">
 	  </tr>
 	  <tr>
-	    <td>sayHi response</td>
-	    <td><span id='sayHiResponse'>- not yet invoked -</span></td>
+	    <td>sayHi response 1</td>
+	    <td><span id='sayHiResponse1'>- not yet invoked -</span></td>
+	  </tr>
+	  <tr>
+	    <td>sayHi response 2</td>
+	    <td><span id='sayHiResponse2'>- not yet invoked -</span></td>
 	  </tr>
 	</table>
 </div>



Mime
View raw message