cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r794099 - in /cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw: client/Client.java server/HelloWorld.java server/HelloWorldImpl.java
Date Tue, 14 Jul 2009 22:37:26 GMT
Author: bimargulies
Date: Tue Jul 14 22:37:26 2009
New Revision: 794099

URL: http://svn.apache.org/viewvc?rev=794099&view=rev
Log:
Add Document trick to the sample.

Modified:
    cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/client/Client.java
    cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/HelloWorld.java
    cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/HelloWorldImpl.java

Modified: cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/client/Client.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/client/Client.java?rev=794099&r1=794098&r2=794099&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/client/Client.java (original)
+++ cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/client/Client.java Tue
Jul 14 22:37:26 2009
@@ -21,6 +21,8 @@
 
 import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.frontend.ClientProxyFactoryBean;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 
 import demo.hw.server.HelloWorld;
 
@@ -41,7 +43,10 @@
         HelloWorld client = (HelloWorld)factory.create();
         System.out.println("Invoke sayHi()....");
         System.out.println(client.sayHi(System.getProperty("user.name")));
-        System.exit(0);
+        Document doc = client.getADocument();
+        Element e = (Element) doc.getFirstChild();
+        System.out.println(e.getTagName());
+        e = (Element) e.getFirstChild();
+        System.out.println(e.getTagName());
     }
-
 }

Modified: cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/HelloWorld.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/HelloWorld.java?rev=794099&r1=794098&r2=794099&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/HelloWorld.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/HelloWorld.java
Tue Jul 14 22:37:26 2009
@@ -18,9 +18,11 @@
  */
 package demo.hw.server;
 
+import org.w3c.dom.Document;
+
 public interface HelloWorld {
     
     String sayHi(String text);
-
+    public Document getADocument();
 }
 

Modified: cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/HelloWorldImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/HelloWorldImpl.java?rev=794099&r1=794098&r2=794099&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/HelloWorldImpl.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/HelloWorldImpl.java
Tue Jul 14 22:37:26 2009
@@ -18,11 +18,34 @@
  */
 package demo.hw.server;
 
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
 public class HelloWorldImpl implements HelloWorld {
 
     public String sayHi(String text) {
         System.out.println("sayHi called");
         return "Hello " + text;
     }
+
+    public Document getADocument() {
+    	DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+    	DocumentBuilder db;
+    	try {
+    		db = dbf.newDocumentBuilder();
+		} catch (ParserConfigurationException e) {
+			throw new RuntimeException(e);
+		}
+		Document doc = db.newDocument();
+		Element carrot = doc.createElement("carrot");
+		doc.appendChild(carrot);
+		carrot.appendChild(doc.createTextNode("Carrots are roots"));
+		
+        return doc;
+    }
 }
 



Mime
View raw message