cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r584566 - in /incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs: client/Client.java client/add_customer.txt client/update_customer.txt server/CustomerService.java server/Server.java
Date Sun, 14 Oct 2007 17:06:18 GMT
Author: jliu
Date: Sun Oct 14 10:06:17 2007
New Revision: 584566

URL: http://svn.apache.org/viewvc?rev=584566&view=rev
Log:
update demo

Modified:
    incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/Client.java
    incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/add_customer.txt
    incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/update_customer.txt
    incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/server/CustomerService.java
    incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/server/Server.java

Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/Client.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/Client.java?rev=584566&r1=584565&r2=584566&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/Client.java
(original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/Client.java
Sun Oct 14 10:06:17 2007
@@ -19,19 +19,19 @@
 
 package demo.jaxrs.client;
 
-import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.InputStream;
 import java.net.URL;
 
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.cxf.io.CachedOutputStream;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.methods.FileRequestEntity;
 import org.apache.commons.httpclient.methods.PostMethod;
 import org.apache.commons.httpclient.methods.PutMethod;
 import org.apache.commons.httpclient.methods.RequestEntity;
 
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.io.CachedOutputStream;
+
 public final class Client {
 
     private Client() {
@@ -47,7 +47,7 @@
          */
 
         // Sent HTTP GET request to query customer info
-        URL url = new URL("http://localhost:9000/customers/1234");
+        URL url = new URL("http://localhost:9000/customers/123");
         System.out.println("Invoking server through HTTP GET to query customer info");
         InputStream in = url.openStream();
         System.out.println(getStringFromInputStream(in));
@@ -94,14 +94,14 @@
         System.out.println("Client Invoking is succeeded!");
         System.exit(0);
     }
-    
-    private static String getStringFromInputStream(InputStream in) throws Exception {   
    
+
+    private static String getStringFromInputStream(InputStream in) throws Exception {
         CachedOutputStream bos = new CachedOutputStream();
         IOUtils.copy(in, bos);
         in.close();
         bos.close();
-        //System.out.println(bos.getOut().toString());        
-        return bos.getOut().toString();        
+        //System.out.println(bos.getOut().toString());
+        return bos.getOut().toString();
     }
 
 }

Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/add_customer.txt
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/add_customer.txt?rev=584566&r1=584565&r2=584566&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/add_customer.txt
(original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/add_customer.txt
Sun Oct 14 10:06:17 2007
@@ -1,4 +1,3 @@
 <Customer>
-  <name>John</name>
-  <id>123456</id>
+  <name>Jack</name>
 </Customer> 

Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/update_customer.txt
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/update_customer.txt?rev=584566&r1=584565&r2=584566&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/update_customer.txt
(original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/client/update_customer.txt
Sun Oct 14 10:06:17 2007
@@ -1,4 +1,4 @@
 <Customer>
-  <name>John</name>
-  <id>123456</id>
+  <name>Mary</name>
+  <id>123</id>
 </Customer> 

Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/server/CustomerService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/server/CustomerService.java?rev=584566&r1=584565&r2=584566&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/server/CustomerService.java
(original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/server/CustomerService.java
Sun Oct 14 10:06:17 2007
@@ -18,8 +18,8 @@
  */
 package demo.jaxrs.server;
 
-import java.util.Map;
 import java.util.HashMap;
+import java.util.Map;
 
 import javax.ws.rs.HttpMethod;
 // import javax.ws.rs.ProduceMime;
@@ -33,7 +33,7 @@
 public class CustomerService {
     @HttpContext UriInfo uriInfo;
 
-    long currentId = 1;
+    long currentId = 123;
     Map<Long, Customer> customers = new HashMap<Long, Customer>();
 
     public CustomerService() {

Modified: incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/server/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/server/Server.java?rev=584566&r1=584565&r2=584566&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/server/Server.java
(original)
+++ incubator/cxf/branches/jliu/distribution/src/main/release/samples/restful_jaxrs/src/demo/jaxrs/server/Server.java
Sun Oct 14 10:06:17 2007
@@ -28,7 +28,7 @@
         JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
         sf.setResourceClasses(CustomerService.class);
         sf.setBindingId(JAXRSBindingFactory.JAXRS_BINDING_ID);
-        sf.setAddress("http://localhost:9080/xml/");
+        sf.setAddress("http://localhost:9000/");
 
         sf.create();
     }



Mime
View raw message