You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bi...@apache.org on 2007/12/20 02:47:22 UTC
svn commit: r605786 - in
/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first:
./ src/ src/demo/ src/demo/hw/ src/demo/hw/server/ src/demo/hw/server/data/
staticContent/ wsdl/
Author: bimargulies
Date: Wed Dec 19 17:47:20 2007
New Revision: 605786
URL: http://svn.apache.org/viewvc?rev=605786&view=rev
Log:
Here's a more interesting JavaScript example.
Added:
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/README.txt (with props)
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/build.xml (with props)
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/cxf.xml (with props)
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExample.java (with props)
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExampleImpl.java (with props)
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/Server.java (with props)
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Beverage.java (with props)
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Category.java (with props)
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Ingredient.java (with props)
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/package-info.java (with props)
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/package-info.java (with props)
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/Beverages.html (with props)
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/wsdl/
incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/wsdl/cxf-servlet.xml (with props)
Added: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/README.txt
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/README.txt?rev=605786&view=auto
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/README.txt (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/README.txt Wed Dec 19 17:47:20 2007
@@ -0,0 +1,68 @@
+Generated JavaScript using jax-ws APIs and jsr-181
+=============================================
+
+This sample shows the generation of JavaScript client code from a
+JAX-WS server.
+
+Prerequisite
+------------
+
+If your environment already includes cxf-manifest-incubator.jar on the
+CLASSPATH, and the JDK and ant bin directories on the PATH
+it is not necessary to set the environment as described in
+the samples directory README. If your environment is not
+properly configured, or if you are planning on using wsdl2java,
+javac, and java to build and run the demos, you must set the
+environment.
+
+
+Building and running the demo using ant
+---------------------------------------
+
+From the base directory of this sample (i.e., where this README file is
+located), the Ant build.xml file can be used to build and run the demo.
+
+Using either UNIX or Windows:
+
+ ant server (from one command line window)
+
+
+Building the demo using javac
+-----------------------------
+
+From the base directory of this sample (i.e., where this README file is
+located), first create the target directory build/classes and then compile
+the provided client and server code.
+
+For UNIX:
+
+ mkdir -p build/classes
+ export CLASSPATH=$CLASSPATH:$CXF_HOME/lib/cxf-manifest-incubator.jar:./build/classes
+ javac -d build/classes src/demo/hw/server/*.java
+
+For Windows:
+ mkdir build\classes
+ set classpath=%classpath%;%CXF_HOME%\lib\cxf-manifest-incubator.jar;.\build\classes
+ javac -d build\classes src\demo\hw\server\*.java
+
+
+Running the demo using java
+---------------------------
+
+From the base directory of this sample (i.e., where this README file is
+located) run the commands, entered on a single command line:
+
+For UNIX (must use forward slashes):
+ java -Djava.util.logging.config.file=$CXF_HOME/etc/logging.properties
+ demo.hw.server.Server &
+
+The server process starts in the background. After running the client,
+use the kill command to terminate the server process.
+
+For Windows (may use either forward or back slashes):
+ start
+ java -Djava.util.logging.config.file=%CXF_HOME%\etc\logging.properties
+ demo.hw.server.Server
+
+A new command windows opens for the server process. After running the
+client, terminate the server process by issuing Ctrl-C in its command window.
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/README.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/README.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/build.xml?rev=605786&view=auto
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/build.xml (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/build.xml Wed Dec 19 17:47:20 2007
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project name="hello world code first demo" default="build" basedir=".">
+
+ <import file="../common_build.xml"/>
+
+ <target name="client" description="run demo client" depends="build">
+ <property name="param" value=""/>
+ <cxfrun classname="demo.hw.client.Client"
+ param1=""
+ param2="${op}"
+ param3="${param}"/>
+ </target>
+
+ <target name="server" description="run demo server" depends="build">
+ <cxfrun classname="demo.hw.server.Server"/>
+ </target>
+
+ <property name="cxf.war.file.name" value="helloworld"/>
+ <target name="war" depends="build">
+ <cxfwar filename="${cxf.war.file.name}.war"/>
+ </target>
+
+ <target name="client-servlet" description="run demo client hitting servlet" depends="build">
+ <property name="param" value=""/>
+ <cxfrun classname="demo.hw.client.Client" param1="${base.url}/helloworld/services/hello_world?wsdl" param2="${op}" param3="${param}"/>
+ </target>
+</project>
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/build.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/build.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/cxf.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/cxf.xml?rev=605786&view=auto
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/cxf.xml (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/cxf.xml Wed Dec 19 17:47:20 2007
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jaxws="http://cxf.apache.org/jaxws"
+ xmlns:cxf="http://cxf.apache.org/core"
+ xmlns:soap="http://cxf.apache.org/bindings/soap"
+ xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+http://cxf.apache.org/bindings/soap http://cxf.apache.org/schema/bindings/soap.xsd
+http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
+http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+">
+
+ <httpj:engine-factory bus="cxf">
+ <!-- The server runs on port 9000 -->
+ <httpj:engine port="9000">
+ <httpj:handlers>
+ <bean
+ class="org.mortbay.jetty.handler.ContextHandler">
+ <property name="contextPath" value="/" />
+ <property name="handler">
+ <bean
+ class="org.mortbay.jetty.handler.ResourceHandler">
+ <property name="baseResource">
+ <bean
+ class="org.mortbay.resource.FileResource">
+ <constructor-arg
+ value="file:staticContent" />
+ </bean>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ <bean class="org.mortbay.jetty.handler.DefaultHandler" />
+ </httpj:handlers>
+ </httpj:engine>
+ </httpj:engine-factory>
+
+ <jaxws:endpoint
+ name="{http://server.hw.demo/}JavascriptExampleImplService"
+ createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="schema-validation-enabled" value="true" />
+ </jaxws:properties>
+ </jaxws:endpoint>
+
+</beans>
+
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/cxf.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/cxf.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/cxf.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExample.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExample.java?rev=605786&view=auto
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExample.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExample.java Wed Dec 19 17:47:20 2007
@@ -0,0 +1,42 @@
+/**
+ * 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.
+ */
+package demo.hw.server;
+
+import java.util.List;
+
+import demo.hw.server.data.Beverage;
+import demo.hw.server.data.Category;
+import demo.hw.server.data.Ingredient;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(targetNamespace = "urn:cxf.apache.org:jsjaxws")
+@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface JavascriptExample {
+ @WebMethod
+ Beverage[] getBeveragesWithIngredient(@WebParam(name = "ingredient") Ingredient i);
+ @WebMethod
+ Beverage[] getBeverageWithIngredientCategory(@WebParam(name = "category") Category c);
+ @WebMethod
+ Beverage[] getBeverageWithIngredientCategories(@WebParam(name = "categories") List<Category> c);
+
+}
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExample.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExample.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExampleImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExampleImpl.java?rev=605786&view=auto
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExampleImpl.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExampleImpl.java Wed Dec 19 17:47:20 2007
@@ -0,0 +1,116 @@
+/**
+ * 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.
+ */
+package demo.hw.server;
+
+import demo.hw.server.data.Beverage;
+import demo.hw.server.data.Category;
+import demo.hw.server.data.Ingredient;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jws.WebService;
+
+@WebService(endpointInterface = "demo.hw.server.JavascriptExample")
+public class JavascriptExampleImpl implements JavascriptExample {
+
+ private List<Beverage> beverages;
+
+ public JavascriptExampleImpl() {
+ beverages = new ArrayList<Beverage>();
+ Ingredient chalk = new Ingredient();
+ chalk.setName("chalk");
+ chalk.setCategory(Category.Mineral);
+ Ingredient broccoli = new Ingredient();
+ broccoli.setName("broccoli");
+ broccoli.setCategory(Category.Vegetable);
+ Ingredient locust = new Ingredient();
+ locust.setName("locust");
+ locust.setCategory(Category.Animal);
+
+ Beverage b = new Beverage();
+ b.setName("broccoli shake");
+ b.setProof(20);
+ Ingredient[] ingredients;
+ ingredients = new Ingredient[2];
+ ingredients[0] = chalk;
+ ingredients[1] = broccoli;
+ b.setIngredients(ingredients);
+ beverages.add(b);
+
+ b = new Beverage();
+ b.setName("green locust");
+ b.setProof(50);
+ ingredients = new Ingredient[2];
+ ingredients[0] = locust;
+ ingredients[1] = broccoli;
+ b.setIngredients(ingredients);
+ beverages.add(b);
+
+ b = new Beverage();
+ b.setName("bug shake");
+ b.setProof(13);
+ ingredients = new Ingredient[2];
+ ingredients[0] = locust;
+ ingredients[1] = chalk;
+ b.setIngredients(ingredients);
+ beverages.add(b);
+
+
+ }
+
+ public Beverage[] getBeverageWithIngredientCategories(List<Category> c) {
+ List<Beverage> matches = new ArrayList<Beverage>();
+ for (Beverage b : beverages) {
+ for (Ingredient i : b.getIngredients()) {
+ if (c.contains(i.getCategory())) {
+ matches.add(b);
+ break;
+ }
+ }
+ }
+ return matches.toArray(new Beverage[0]);
+ }
+
+ public Beverage[] getBeverageWithIngredientCategory(Category c) {
+ List<Beverage> matches = new ArrayList<Beverage>();
+ for (Beverage b : beverages) {
+ for (Ingredient i : b.getIngredients()) {
+ if (c == i.getCategory()) {
+ matches.add(b);
+ break;
+ }
+ }
+ }
+ return matches.toArray(new Beverage[0]);
+ }
+
+ public Beverage[] getBeveragesWithIngredient(Ingredient i) {
+ List<Beverage> matches = new ArrayList<Beverage>();
+ for (Beverage b : beverages) {
+ for (Ingredient bi : b.getIngredients()) {
+ if(bi == i) {
+ matches.add(b);
+ break;
+ }
+ }
+ }
+ return matches.toArray(new Beverage[0]);
+ }
+}
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExampleImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/JavascriptExampleImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/Server.java?rev=605786&view=auto
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/Server.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/Server.java Wed Dec 19 17:47:20 2007
@@ -0,0 +1,41 @@
+/**
+ * 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.
+ */
+
+package demo.hw.server;
+
+import javax.xml.ws.Endpoint;
+
+public class Server {
+
+ protected Server() throws Exception {
+ System.out.println("Starting Server");
+ JavascriptExampleImpl implementor = new JavascriptExampleImpl();
+ String address = "http://localhost:9000/beverages";
+ Endpoint.publish(address, implementor);
+ }
+
+ public static void main(String args[]) throws Exception {
+ new Server();
+ System.out.println("Server ready...");
+
+ Thread.sleep(5 * 60 * 1000);
+ System.out.println("Server exiting");
+ System.exit(0);
+ }
+}
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/Server.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/Server.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Beverage.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Beverage.java?rev=605786&view=auto
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Beverage.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Beverage.java Wed Dec 19 17:47:20 2007
@@ -0,0 +1,46 @@
+/**
+ * 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.
+ */
+package demo.hw.server.data;
+
+public class Beverage {
+
+ private String name;
+ private Ingredient[] ingredients;
+ private int proof;
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public Ingredient[] getIngredients() {
+ return ingredients;
+ }
+ public void setIngredients(Ingredient[] ingredients) {
+ this.ingredients = ingredients;
+ }
+ public int getProof() {
+ return proof;
+ }
+ public void setProof(int proof) {
+ this.proof = proof;
+ }
+
+}
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Beverage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Beverage.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Category.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Category.java?rev=605786&view=auto
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Category.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Category.java Wed Dec 19 17:47:20 2007
@@ -0,0 +1,26 @@
+/**
+ * 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.
+ */
+
+package demo.hw.server.data;
+
+public enum Category {
+ Animal,
+ Vegetable,
+ Mineral;
+}
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Category.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Category.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Ingredient.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Ingredient.java?rev=605786&view=auto
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Ingredient.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Ingredient.java Wed Dec 19 17:47:20 2007
@@ -0,0 +1,53 @@
+/**
+ * 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.
+ */
+package demo.hw.server.data;
+
+public class Ingredient {
+ @Override
+ public boolean equals(Object obj) {
+ try {
+ Ingredient other = (Ingredient)obj;
+ return other.name.equals(name) && other.category == category;
+ } catch (ClassCastException cce) {
+ return false;
+ }
+ }
+
+ private String name;
+ private Category category;
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public Category getCategory() {
+ return category;
+ }
+ public void setCategory(Category category) {
+ this.category = category;
+ }
+
+ @Override
+ public int hashCode() {
+ return name.hashCode() + (37 * category.hashCode());
+ }
+}
+
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Ingredient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/Ingredient.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/package-info.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/package-info.java?rev=605786&view=auto
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/package-info.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/package-info.java Wed Dec 19 17:47:20 2007
@@ -0,0 +1,21 @@
+/**
+ * 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.
+ */
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "urn:cxf.apache.org:jsjaxws:data")
+package demo.hw.server.data;
\ No newline at end of file
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/data/package-info.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/package-info.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/package-info.java?rev=605786&view=auto
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/package-info.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/package-info.java Wed Dec 19 17:47:20 2007
@@ -0,0 +1,20 @@
+/**
+ * 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.
+ */
+@javax.xml.bind.annotation.XmlSchema(namespace = "urn:cxf.apache.org:jsjaxws")
+package demo.hw.server;
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/src/demo/hw/server/package-info.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/Beverages.html
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/Beverages.html?rev=605786&view=auto
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/Beverages.html (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/Beverages.html Wed Dec 19 17:47:20 2007
@@ -0,0 +1,95 @@
+<html>
+<!--
+ 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.
+-->
+<head>
+<title>JAX-WS/Complex Type JavaScript Client Sample</title>
+<!-- Generate and retrieve a JavaScript client for the server. -->
+<script type="text/javascript" src="/beverages?js"></script>
+<script type="text/javascript">
+<!-- create an object that talks to the server. -->
+var server = new urn_cxf_apache_org_jsjaxws_JavascriptExample();
+<!-- set the URL for the service. No cross-scripting allowed. -->
+server.url = "/beverages";
+
+var responseSpan;
+
+<!-- This is the function called upon success. -->
+function beverageListResponse(response)
+{
+ responseSpan = document.getElementById('beverages');
+ var beverages = response.getItem();
+ var str = '';
+ for(b in beverages) {
+ str = str + beverages[b].getName();
+ str = str + ' ';
+ }
+ responseSpan.firstChild.nodeValue = str;
+}
+
+<!-- This is the function called for an error. -->
+function onerror(error)
+{
+ alert('error ' + error);
+}
+
+<!-- This function is invoked from the button press to run the service. -->
+function invokeCategoryQuery()
+{
+ responseSpan = document.getElementById('beverages');
+ responseSpan.firstChild.nodeValue = " - pending - ";
+ var catControl = document.getElementById('category');
+ var category = catControl.options[catControl.selectedIndex].value;
+ server.getBeverageWithIngredientCategory(beverageListResponse, onerror, category);
+}
+</script>
+</head>
+<body>
+<h1>
+Hello World Sample
+</h1>
+<form>
+<div>
+ <table>
+ <tr>
+ <td>Category
+ </td>
+ <td>
+ <select id='category'>
+ <option value="">Choose a Category...</option>
+ <option value="Animal">Animal</option>
+ <option value="Vegetable">Vegetable</option>
+ <option value="Mineral">Mineral</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>Query by Category</td>
+ <td><input type="button"
+ value="invoke" name="categoryQuery"
+ onClick="invokeCategoryQuery()">
+ </tr>
+ <tr>
+ <td>Beverages</td>
+ <td><span id='beverages'>- not yet invoked -</span></td>
+ </tr>
+ </table>
+</div>
+</form>
+</body>
+</html>
\ No newline at end of file
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/Beverages.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/Beverages.html
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/staticContent/Beverages.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Added: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/wsdl/cxf-servlet.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/wsdl/cxf-servlet.xml?rev=605786&view=auto
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/wsdl/cxf-servlet.xml (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/wsdl/cxf-servlet.xml Wed Dec 19 17:47:20 2007
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jaxws="http://cxf.apache.org/jaxws"
+ xmlns:soap="http://cxf.apache.org/bindings/soap"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd
+http://cxf.apache.org/jaxws
+http://cxf.apache.org/schemas/jaxws.xsd">
+
+ <jaxws:server id="beverages" serviceClass="demo.hw.server.JavascriptExample" address="/beverages">
+ <jaxws:serviceBean>
+ <bean class="demo.hw.server.JavascriptExampleImpl" />
+ </jaxws:serviceBean>
+ </jaxws:server>
+</beans>
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/wsdl/cxf-servlet.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/wsdl/cxf-servlet.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/js_browser_client_java_first/wsdl/cxf-servlet.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml