cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r528895 - in /incubator/cxf/trunk: distribution/ distribution/src/main/release/samples/hello_world/ distribution/src/main/release/samples/hello_world/wsdl/ distribution/src/main/release/samples/restful/ distribution/src/main/release/samples...
Date Sun, 15 Apr 2007 00:14:44 GMT
Author: dandiep
Date: Sat Apr 14 17:14:42 2007
New Revision: 528895

URL: http://svn.apache.org/viewvc?view=rev&rev=528895
Log:
Add a RESTful HTTP Binding demo which shows how to use JSON and XML endpoints. Move the RESTful dispatch demo to the restful_dispatch directory. Also, update the http-binding pom to use the latest JRA release with the correct organization/license info.

Added:
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_dispatch/
      - copied from r528574, incubator/cxf/trunk/distribution/src/main/release/samples/restful/
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/README   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.json   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.xml   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/build.xml   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/index.html   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/ClientMain.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customer.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundDetails.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundFault.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerService.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerServiceImpl.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customers.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomer.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomers.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Main.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/index.jaxb   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/package-info.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/test.html   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/update.xml   (with props)
Removed:
    incubator/cxf/trunk/distribution/src/main/release/samples/restful/
Modified:
    incubator/cxf/trunk/distribution/pom.xml
    incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/cxf.xml
    incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/wsdl/cxf-servlet.xml
    incubator/cxf/trunk/rt/bindings/http/pom.xml

Modified: incubator/cxf/trunk/distribution/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/pom.xml?view=diff&rev=528895&r1=528894&r2=528895
==============================================================================
--- incubator/cxf/trunk/distribution/pom.xml (original)
+++ incubator/cxf/trunk/distribution/pom.xml Sat Apr 14 17:14:42 2007
@@ -179,6 +179,11 @@
             <artifactId>cxf-rt-frontend-simple</artifactId>
             <version>${pom.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.codehaus.jettison</groupId>
+            <artifactId>jettison</artifactId>
+            <version>1.0-beta-1</version>
+        </dependency>
     </dependencies>
 
     <build>

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/cxf.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/cxf.xml?view=diff&rev=528895&r1=528894&r2=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/cxf.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/cxf.xml Sat Apr 14 17:14:42 2007
@@ -1,18 +1,25 @@
 <beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+      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/schema/bindings/soap.xsd
+http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">
 
     <bean id="{http://apache.org/hello_world_soap_http}SOAPService" abstract="true">
-        <property name="enableSchemaValidationForAllPort">
-            <value>true</value>
-        </property>
-    </bean>
-
-    <bean id="{http://apache.org/hello_world_soap_http}SoapPort" abstract="true">
-        <property name="enableSchemaValidation">
-            <value>true</value>
+        <property name="properties">
+        	<map>
+        		<entry key="schema-validation-enabled" value="true" />
+        	</map>
         </property>
     </bean>
 
+    <jaxws:endpoint id="{http://apache.org/hello_world_soap_http}SoapPort"
+		abstract="true">
+		<jaxws:properties>
+			<entry key="schema-validation-enabled" value="true" />
+		</jaxws:properties>
+	</jaxws:endpoint>
 </beans>
 

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/wsdl/cxf-servlet.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/wsdl/cxf-servlet.xml?view=diff&rev=528895&r1=528894&r2=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/wsdl/cxf-servlet.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/wsdl/cxf-servlet.xml Sat Apr 14 17:14:42 2007
@@ -17,15 +17,18 @@
   specific language governing permissions and limitations
   under the License.
 -->
-<endpoints>
+<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/schema/bindings/soap.xsd
+http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">
 
-    <endpoint
-        name="hello_world"
-        interface="org.apache.hello_world_soap_http.Greeter"
+    <jaxws:endpoint
+        id="hello_world"
         implementation="demo.hw.server.GreeterImpl"
-        wsdl="WEB-INF/wsdl/hello_world.wsdl"
-        service="{http://apache.org/hello_world_soap_http}SOAPService"
-        port="{http://apache.org/hello_world_soap_http}SOAPPort"
+        wsdlLocation="WEB-INF/wsdl/hello_world.wsdl"
         url-pattern="/hello_world" />
-
-</endpoints>
+</beans>

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/README
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/README?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/README (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/README Sat Apr 14 17:14:42 2007
@@ -0,0 +1,40 @@
+This demo shows how to create RESTful services using CXF's HTTP binding.
+The server in the demo creates 3 different endpoints: a RESTful XML
+endpoint, a RESTful JSON endpoint, and a SOAP endpoint.
+
+[RUNNING THE DEMO]
+The demo has a class called com.acme.customer.Main which starts up various
+endpoints. To start this server run the command:
+
+$ ant server
+
+Once it is running try going to the following URLs:
+
+http://localhost:8080/xml/customers
+http://localhost:8080/json/customers
+http://localhost:8080/xml/customers/123
+http://localhost:8080/json/customers/123
+
+These will serve out XML and JSON representation of the resources.
+
+There is an HTML page that is served by CXF so you can try using the
+JSON service via Javascript. Just go to:
+
+http://localhost:8080/test.html
+
+Included are some example JSON and XML files so you can add or update
+customers using wget. Try the following commands and look at the results:
+
+wget --post-file add.json http://localhost:8080/json/customers
+wget --post-file add.xml http://localhost:8080/xml/customers
+wget --post-file update.xml http://localhost:8080/xml/customers/123
+
+And if you are interested in SOAP you can try the SOAP endpoint:
+
+http://localhost:8080/soap?wsdl
+
+[RUNNING THE CLIENT]
+The demo also includes a Client class which accesses data using 
+HTTP. To run this demo, do:
+
+$ ant client
\ No newline at end of file

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

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/README
------------------------------------------------------------------------------
    svn:executable = *

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

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.json
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.json?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.json (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.json Sat Apr 14 17:14:42 2007
@@ -0,0 +1,6 @@
+{ 
+  "acme.Customer" : {
+    "acme.name" : "Jim Bob"
+  }
+}
+    
\ No newline at end of file

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.json
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.xml?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.xml (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.xml Sat Apr 14 17:14:42 2007
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<customer xmlns="http://customer.acme.com">
+<name>Jim Bob</name>
+</customer>

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/add.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/build.xml?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/build.xml (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/build.xml Sat Apr 14 17:14:42 2007
@@ -0,0 +1,33 @@
+<?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="RESTful HTTP Binding demo" default="build" basedir=".">
+    <property name="codegen.notrequired" value="true"/>
+
+    <import file="../common_build.xml"/>        
+        
+    <target name="client" description="run demo client" depends="build">
+        <cxfrun classname="com.acme.customer.ClientMain"/>
+    </target> 
+        
+    <target name="server" description="run demo server" depends="build">
+        <cxfrun classname="com.acme.customer.Main"/>
+    </target>
+
+</project>

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/build.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/build.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/index.html
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/index.html?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/index.html (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/index.html Sat Apr 14 17:14:42 2007
@@ -0,0 +1 @@
+<return xmlns:ns3="http://customer.acme.com" xmlns:ns2="http://www.w3.org/2005/08/addressing/wsdl">2</return>
\ No newline at end of file

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/index.html
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/index.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/index.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/ClientMain.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/ClientMain.java?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/ClientMain.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/ClientMain.java Sat Apr 14 17:14:42 2007
@@ -0,0 +1,45 @@
+/**
+ * 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 com.acme.customer;
+
+import org.apache.cxf.binding.http.HttpBindingFactory;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+
+public final class ClientMain {
+    private ClientMain() { }
+    
+    public static void main(String[] args) throws Exception {
+        JaxWsProxyFactoryBean sf = new JaxWsProxyFactoryBean();
+        sf.setServiceClass(CustomerService.class);
+
+        // Turn off wrapped mode to make our xml prettier
+        sf.getServiceFactory().setWrapped(false);
+
+        // Use the HTTP Binding which understands the Java Rest Annotations
+        sf.getClientFactoryBean().setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
+        sf.setAddress("http://localhost:8080/xml/");
+        CustomerService cs = (CustomerService)sf.create();
+
+        Customers customers = cs.getCustomers();
+        for (Customer c : customers.getCustomer()) {
+            System.out.println("Found customer " + c.getName());
+        }
+    }
+
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/ClientMain.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/ClientMain.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/ClientMain.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customer.java?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customer.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customer.java Sat Apr 14 17:14:42 2007
@@ -0,0 +1,45 @@
+/**
+ * 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 com.acme.customer;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+// START SNIPPET: bean
+@XmlRootElement(name = "Customer")
+public class Customer {
+    private long id;
+    private String name;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}
+// END SNIPPET: bean

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customer.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customer.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundDetails.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundDetails.java?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundDetails.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundDetails.java Sat Apr 14 17:14:42 2007
@@ -0,0 +1,35 @@
+/**
+ * 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 com.acme.customer;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class CustomerNotFoundDetails {
+    private long id;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundDetails.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundDetails.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundDetails.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundFault.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundFault.java?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundFault.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundFault.java Sat Apr 14 17:14:42 2007
@@ -0,0 +1,35 @@
+/**
+ * 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 com.acme.customer;
+
+import javax.xml.ws.WebFault;
+
+@WebFault
+public class CustomerNotFoundFault extends Exception {
+    private CustomerNotFoundDetails details;
+
+    public CustomerNotFoundFault(CustomerNotFoundDetails details) {
+        super();
+        this.details = details;
+    }
+
+    public CustomerNotFoundDetails getFaultInfo() {
+        return details;
+    }
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundFault.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundFault.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerNotFoundFault.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerService.java?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerService.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerService.java Sat Apr 14 17:14:42 2007
@@ -0,0 +1,59 @@
+/**
+ * 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 com.acme.customer;
+
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+
+import org.codehaus.jra.Delete;
+import org.codehaus.jra.Get;
+import org.codehaus.jra.HttpResource;
+import org.codehaus.jra.Post;
+import org.codehaus.jra.Put;
+
+@WebService
+public interface CustomerService {
+
+    @Get
+    @HttpResource(location = "/customers")
+    @WebResult(name = "Customers")
+    Customers getCustomers();
+
+    @Get
+    @HttpResource(location = "/customers/{id}")
+    Customer getCustomer(@WebParam(name = "GetCustomer")
+                         GetCustomer getCustomer) throws CustomerNotFoundFault;
+
+    @Put
+    @HttpResource(location = "/customers/{id}")
+    void updateCustomer(@WebParam(name = "Customer")
+                        Customer c);
+
+    @Post
+    @HttpResource(location = "/customers")
+    long addCustomer(@WebParam(name = "Customer")
+                     Customer c);
+
+    @Delete
+    @HttpResource(location = "/customers/{id}")
+    void deleteCustomer(@WebParam(name = "id")
+                        long id) throws CustomerNotFoundFault;
+
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerService.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerServiceImpl.java?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerServiceImpl.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerServiceImpl.java Sat Apr 14 17:14:42 2007
@@ -0,0 +1,77 @@
+/**
+ * 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 com.acme.customer;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jws.WebService;
+
+// END SNIPPET: service
+@WebService(endpointInterface = "com.acme.customer.CustomerService")
+public class CustomerServiceImpl implements CustomerService {
+    long currentId = 1;
+    Map<Long, Customer> customers = new HashMap<Long, Customer>();
+
+    public CustomerServiceImpl() {
+        Customer customer = createCustomer();
+        customers.put(customer.getId(), customer);
+    }
+
+    public Customers getCustomers() {
+        Customers c = new Customers();
+        c.setCustomer(customers.values());
+        return c;
+    }
+
+    public Customer getCustomer(GetCustomer getCustomer) throws CustomerNotFoundFault {
+        Customer c = customers.get(getCustomer.getId());
+        if (c == null) {
+            CustomerNotFoundDetails details = new CustomerNotFoundDetails();
+            details.setId(getCustomer.getId());
+            throw new CustomerNotFoundFault(details);
+        }
+        return c;
+    }
+
+    public void updateCustomer(Customer c) {
+        customers.put(c.getId(), c);
+    }
+
+    public long addCustomer(Customer c) {
+        long id = ++currentId;
+        c.setId(id);
+
+        customers.put(id, c);
+
+        return c.getId();
+    }
+
+    public void deleteCustomer(long id) {
+        customers.remove(id);
+    }
+
+    final Customer createCustomer() {
+        Customer c = new Customer();
+        c.setName("Dan Diephouse");
+        c.setId(123);
+        return c;
+    }
+}
+// END SNIPPET: service

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerServiceImpl.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/CustomerServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customers.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customers.java?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customers.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customers.java Sat Apr 14 17:14:42 2007
@@ -0,0 +1,38 @@
+/**
+ * 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 com.acme.customer;
+
+import java.util.Collection;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+// START SNIPPET: bean
+@XmlRootElement
+public class Customers {
+    private Collection<Customer> customers;
+
+    public Collection<Customer> getCustomer() {
+        return customers;
+    }
+
+    public void setCustomer(Collection<Customer> c) {
+        this.customers = c;
+    }
+}
+// END SNIPPET: bean

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customers.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customers.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Customers.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomer.java?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomer.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomer.java Sat Apr 14 17:14:42 2007
@@ -0,0 +1,35 @@
+/**
+ * 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 com.acme.customer;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "GetCustomer")
+public class GetCustomer {
+    private long id;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomer.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomer.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomers.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomers.java?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomers.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomers.java Sat Apr 14 17:14:42 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 com.acme.customer;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "GetCustomers")
+public class GetCustomers {
+
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomers.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomers.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/GetCustomers.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Main.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Main.java?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Main.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Main.java Sat Apr 14 17:14:42 2007
@@ -0,0 +1,172 @@
+/**
+ * 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 com.acme.customer;
+
+import java.io.FileInputStream;
+import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.binding.http.HttpBindingFactory;
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.message.ExchangeImpl;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.service.invoker.BeanInvoker;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.transport.Destination;
+import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.transport.DestinationFactoryManager;
+import org.apache.cxf.transport.MessageObserver;
+import org.codehaus.jettison.mapped.MappedXMLInputFactory;
+import org.codehaus.jettison.mapped.MappedXMLOutputFactory;
+
+public final class Main {
+    private Main() { }
+    
+    public static void main(String[] args) throws Exception {
+        CustomerServiceImpl bs = new CustomerServiceImpl();
+
+        createSoapService(bs);
+
+        createRestService(bs);
+
+        createJsonRestService(bs);
+
+        serveHTML();
+        
+        System.out.println("Started CustomerService!");
+    }
+
+    private static void createRestService(Object serviceObj) {
+        // Build up the server factory bean
+        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
+        sf.setServiceClass(CustomerService.class);
+        // Use the HTTP Binding which understands the Java Rest Annotations
+        sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
+        sf.setAddress("http://localhost:8080/xml/");
+        sf.getServiceFactory().setInvoker(new BeanInvoker(serviceObj));
+
+        // Turn the "wrapped" style off. This means that CXF won't generate
+        // wrapper XML elements and we'll have prettier XML text. This
+        // means that we need to stick to one request and one response
+        // parameter though.
+        sf.getServiceFactory().setWrapped(false);
+
+        sf.create();
+    }
+
+    private static void createJsonRestService(Object serviceObj) {
+        // Build up the server factory bean
+        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
+        sf.setServiceClass(CustomerService.class);
+        // Use the HTTP Binding which understands the Java Rest Annotations
+        sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
+        sf.setAddress("http://localhost:8080/json");
+        sf.getServiceFactory().setInvoker(new BeanInvoker(serviceObj));
+
+        // Turn the "wrapped" style off. This means that CXF won't generate
+        // wrapper JSON elements and we'll have prettier JSON text. This
+        // means that we need to stick to one request and one response
+        // parameter though.
+        sf.getServiceFactory().setWrapped(false);
+
+        // Tell CXF to use a different Content-Type for the JSON endpoint
+        // This should probably be application/json, but text/plain allows
+        // us to view easily in a web browser.
+        Map<String, Object> properties = new HashMap<String, Object>();
+        properties.put("Content-Type", "text/plain");
+
+        // Set up the JSON StAX implementation
+        Map<String, String> nstojns = new HashMap<String, String>();
+        nstojns.put("http://customer.acme.com", "acme");
+
+        MappedXMLInputFactory xif = new MappedXMLInputFactory(nstojns);
+        properties.put(XMLInputFactory.class.getName(), xif);
+
+        MappedXMLOutputFactory xof = new MappedXMLOutputFactory(nstojns);
+        properties.put(XMLOutputFactory.class.getName(), xof);
+
+        sf.setProperties(properties);
+
+        sf.create();
+    }
+
+    private static void createSoapService(Object serviceObj) {
+        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
+        sf.setServiceClass(CustomerService.class);
+        sf.setAddress("http://localhost:8080/soap");
+        sf.getServiceFactory().setInvoker(new BeanInvoker(serviceObj));
+
+        sf.create();
+    }
+
+    /**
+     * Serve out a static HTTP file because the Javascript XMLHttpRequest can
+     * only work within one domain.
+     */
+    private static void serveHTML() throws Exception {
+        Bus bus = BusFactory.getDefaultBus();
+        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
+        DestinationFactory df = dfm
+            .getDestinationFactory("http://cxf.apache.org/transports/http/configuration");
+
+        EndpointInfo ei = new EndpointInfo();
+        ei.setAddress("http://localhost:8080/test.html");
+
+        Destination d = df.getDestination(ei);
+        d.setMessageObserver(new MessageObserver() {
+
+            public void onMessage(Message message) {
+                try {
+                    // HTTP seems to need this right now...
+                    ExchangeImpl ex = new ExchangeImpl();
+                    ex.setInMessage(message);
+
+                    Conduit backChannel = message.getDestination().getBackChannel(message, null, null);
+
+                    MessageImpl res = new MessageImpl();
+                    res.put(Message.CONTENT_TYPE, "text/html");
+                    backChannel.prepare(res);
+
+                    OutputStream out = res.getContent(OutputStream.class);
+                    FileInputStream is = new FileInputStream("test.html");
+                    IOUtils.copy(is, out, 2048);
+
+                    out.flush();
+
+                    out.close();
+                    is.close();
+
+                    backChannel.close(res);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+
+        });
+    }
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Main.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Main.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/Main.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/index.jaxb
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/index.jaxb?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/index.jaxb (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/index.jaxb Sat Apr 14 17:14:42 2007
@@ -0,0 +1 @@
+Customer
\ No newline at end of file

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/index.jaxb
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/package-info.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/package-info.java?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/package-info.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/package-info.java Sat Apr 14 17:14:42 2007
@@ -0,0 +1,22 @@
+/**
+ * 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 = "http://customer.acme.com", 
+                                     elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package com.acme.customer;
+

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/package-info.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/src/com/acme/customer/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/test.html
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/test.html?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/test.html (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/test.html Sat Apr 14 17:14:42 2007
@@ -0,0 +1,80 @@
+<html>
+ <head>
+   <title>Jettison/CXF AJAX Demo</title>
+   <script>
+function getCustomers() {
+    var xmlhttp = null;
+	if (window.XMLHttpRequest) {
+	  xmlhttp = new XMLHttpRequest();
+	  if ( typeof xmlhttp.overrideMimeType != 'undefined') {
+	    xmlhttp.overrideMimeType('text/plain');
+	  }
+	} else if (window.ActiveXObject) {
+	  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+	} else {
+	  alert('Perhaps your browser does not support xmlhttprequests?');
+	}
+	
+	xmlhttp.onreadystatechange = function() {
+	  if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
+	    var res = '(' + xmlhttp.responseText + ')';
+	    var customers = eval(res);
+	    customers = customers['acme.customers'];
+	    
+	    var customer = customers['acme.customer'];
+		if (customer.length) {
+		  for (var i = 0; i < customer.length; i++) {
+		    addCustomer(customer[i]);
+		  }
+		} else {
+		  addCustomer(customer);
+		  
+        }
+	  } else {
+	    // wait for the call to complete
+	  }
+	};
+	
+	xmlhttp.open('GET', "http://localhost:8080/json/customers", true);
+    xmlhttp.send(null);
+}
+
+function addCustomer(c) {
+  var t = document.getElementById('customertable');
+  
+  var tr = document.createElement("tr");
+  var td = document.createElement("td");
+  var id = document.createTextNode(c['acme.id']);
+  td.appendChild(id);
+  tr.appendChild(td);
+  td = document.createElement("td");
+  var name = document.createTextNode(c['acme.name']);
+  td.appendChild(name);
+  tr.appendChild(td);
+  t.appendChild(tr);
+}
+   </script>
+ </head>
+ <body>
+   <h1>Jettison/CXF AJAX Demo</h1>
+   <p>
+     The button below will go and hit the URL 
+     <a href="http://localhost:8080/json/customers">http://localhost:8080/json/customers</a>
+     and list the customers below in a table.
+   <p>
+   <p>
+     <input type="button" value="Get Customers!" onClick="javascript: getCustomers();" />
+   <p>
+   <p>
+     <h1>Customers</h1>
+     <!-- Yes, this is using a table because I'm incompotent with HTML! -->
+     <table style="border: 1px black solid;" cellspacing="5" id="customertable>
+       <tr>
+         <th><strong>ID</strong></th>
+         <th><strong>Customer Name</strong></th>
+       </tr>
+     </table>
+     </div>
+   </p>
+ </body>
+</html>
\ No newline at end of file

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/test.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/test.html
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/test.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/test.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/update.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/update.xml?view=auto&rev=528895
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/update.xml (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/update.xml Sat Apr 14 17:14:42 2007
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<customer xmlns="http://customer.acme.com">
+<id>123</id>
+<name>Danno Manno</name>
+</customer>
\ No newline at end of file

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/update.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/update.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/update.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/restful_http_binding/update.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/rt/bindings/http/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/http/pom.xml?view=diff&rev=528895&r1=528894&r2=528895
==============================================================================
--- incubator/cxf/trunk/rt/bindings/http/pom.xml (original)
+++ incubator/cxf/trunk/rt/bindings/http/pom.xml Sat Apr 14 17:14:42 2007
@@ -34,7 +34,7 @@
         <dependency>
             <groupId>org.codehaus.jra</groupId>
             <artifactId>jra</artifactId>
-            <version>1.0-alpha-2</version>
+            <version>1.0-alpha-3</version>
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>



Mime
View raw message