Author: ffang
Date: Fri Jun 29 02:43:40 2007
New Revision: 551838

URL: http://svn.apache.org/viewvc?view=rev&rev=551838
Log:
[CXF-754] add js client sample provided by Jeff Zhang, thanks Jeff

Added:
    incubator/cxf/trunk/distribution/src/main/release/samples/js_client/
    
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/README.txt  
 (with props)
    
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/logging.properties
   (with props)
    
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/run_client.bat
   (with props)
    
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/run_client.sh
   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/js_client/src/
    
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/src/helloworld.js
   (with props)

Added: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/README.txt
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_client/README.txt?view=auto&rev=551838
==============================================================================
--- 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/README.txt 
(added)
+++ 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/README.txt 
Fri Jun 29 02:43:40 2007
@@ -0,0 +1,62 @@
+Hello World Client Demo using JavaScript 
+=========================================================
+
+The client demo demonstrates the use of the JavaScript to call CXF server
+
+The client side makes call by JAXWS. It use mozilla Rhino library to read 
+java script file and run it.
+
+Prerequisite
+------------
+
+You should set the CXF_HOME environment to the CXF install path in 
+run_client and run_client.bat files.
+
+If your environment already includes cxf-manifest-incubator.jar on the
+CLASSPATH, and the JDK and ant bin directories on the PATH.
+
+You also need to download js-1.6R5.jar from
+(http://repo1.maven.org/maven2/rhino/js/1.6R5/) and xbean-2.2.0.jar 
+from (http://repo1.maven.org/maven2/xmlbeans/xbean/2.2.0/) and place
+these two jars under CXF_HOME/lib directory. 
+
+
+Building and running the demo server using ant
+---------------------------------------
+
+From the samples/hello_world directory, the ant build script
+can be used to build and run the demo.
+
+Using either UNIX or Windows:
+
+  ant build
+  ant server  (in the background or another window)
+
+To remove the code generated from the WSDL file and the .class
+files, run:
+
+  ant clean
+
+Running the demo using javascript
+---------------------------
+
+From the samples/js_client directory run the commands, entered on a
+single command line:
+
+For UNIX (must use forward slashes):
+    ./run_client.sh
+
+For Windows (may use either forward or back slashes):
+    run_client.bat
+
+When running the client, it can terminate the server process by issuing Ctrl-C 
in its command window.
+
+It will show the output:
+invoke sayHi().   return Bonjour
+invoke greetMe(String).   return Hello Jeff
+
+The same time, server give the output:
+     [java] Executing operation sayHi
+
+     [java] Executing operation greetMe
+     [java] Message received: Jeff

Propchange: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/README.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/logging.properties
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_client/logging.properties?view=auto&rev=551838
==============================================================================
--- 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/logging.properties
 (added)
+++ 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/logging.properties
 Fri Jun 29 02:43:40 2007
@@ -0,0 +1,2 @@
+java.util.logging.ConsoleHandler.level = WARN
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

Propchange: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/logging.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/logging.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/logging.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/run_client.bat
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_client/run_client.bat?view=auto&rev=551838
==============================================================================
--- 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/run_client.bat
 (added)
+++ 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/run_client.bat
 Fri Jun 29 02:43:40 2007
@@ -0,0 +1,3 @@
+set HELLO_WORLD_DEMO=%CXF_HOME%\samples\hello_world
+
+%JAVA_HOME%\bin\java -classpath 
%CXF_HOME%\lib\cxf-manifest-incubator.jar;%CXF_HOME%\lib\js-1.6R5.jar;%HELLO_WORLD_DEMO%\build\classes;%CLASSPATH%
 -Djava.util.logging.config.file=logger.properties 
org.mozilla.javascript.tools.shell.Main -f src\helloworld.js

Propchange: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/run_client.bat
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/run_client.sh
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_client/run_client.sh?view=auto&rev=551838
==============================================================================
--- 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/run_client.sh
 (added)
+++ 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/run_client.sh
 Fri Jun 29 02:43:40 2007
@@ -0,0 +1,2 @@
+HELLO_WORLD_DEMO=$CXF_HOME/samples/hello_world
+$JAVA_HOME/bin/java -classpath 
$CXF_HOME/lib/cxf-manifest-incubator.jar:$CXF_HOME/lib/js-1.6R5.jar:$HELLO_WORLD_DEMO/build/classes:$CLASSPATH
 -Djava.util.logging.config.file=logger.properties 
org.mozilla.javascript.tools.shell.Main -f src/helloworld.js

Propchange: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/run_client.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/run_client.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/src/helloworld.js
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_client/src/helloworld.js?view=auto&rev=551838
==============================================================================
--- 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/src/helloworld.js
 (added)
+++ 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/src/helloworld.js
 Fri Jun 29 02:43:40 2007
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+importPackage(Packages.java.io);
+importPackage(Packages.javax.xml.namespace);
+importPackage(Packages.org.apache.hello_world_soap_http);
+
+var qname=new 
Packages.javax.xml.namespace.QName("http://apache.org/hello_world_soap_http";, 
"SOAPService");
+var curpath=new File("..");
+var sepa=File.separator;
+var 
hwpath=curpath.getAbsolutePath()+sepa+"hello_world"+sepa+"wsdl"+sepa+"hello_world.wsdl";
+var url = new File(hwpath).toURL();
+var ss=new SOAPService(url,qname);
+var port = ss.getSoapPort();
+var resp=port.sayHi();
+print("invoke sayHi().   return " + resp);
+resp=port.greetMe("Jeff");
+print("invoke greetMe(String).   return " + resp);

Propchange: 
incubator/cxf/trunk/distribution/src/main/release/samples/js_client/src/helloworld.js
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to