axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r473317 - in /webservices/axis2/branches/java/1_1/modules: kernel/src/org/apache/axis2/description/AxisService.java samples/servicelifecycle/src/client/LibraryServiceClient.java
Date Fri, 10 Nov 2006 11:34:34 GMT
Author: deepal
Date: Fri Nov 10 03:34:30 2006
New Revision: 473317

URL: http://svn.apache.org/viewvc?view=rev&rev=473317
Log:
- added a method to AxisService to enable it on all the tansport , there was a getter method
but no setter method
- Improved a sample to print the book info nicely 

Modified:
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/client/LibraryServiceClient.java

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/AxisService.java?view=diff&rev=473317&r1=473316&r2=473317
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/AxisService.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/AxisService.java
Fri Nov 10 03:34:30 2006
@@ -1130,6 +1130,14 @@
         return enableAllTransports;
     }
 
+    /**
+     * To eneble service to be expose in all the transport
+     * @param enableAllTransports
+     */
+    public void setEnableAllTransports(boolean enableAllTransports) {
+        this.enableAllTransports = enableAllTransports;
+    }
+
     public List getExposedTransports() {
         return this.exposedTransports;
     }

Modified: webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/client/LibraryServiceClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/client/LibraryServiceClient.java?view=diff&rev=473317&r1=473316&r2=473317
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/client/LibraryServiceClient.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/client/LibraryServiceClient.java
Fri Nov 10 03:34:30 2006
@@ -3,12 +3,15 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.Options;
+import org.apache.axis2.databinding.utils.BeanUtil;
+import org.apache.axis2.engine.DefaultObjectSupplier;
 import org.apache.axis2.rpc.client.RPCServiceClient;
 import sample.servicelifecycle.bean.Book;
 
 import javax.xml.namespace.QName;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Iterator;
 
 /*
 * Copyright 2004,2005 The Apache Software Foundation.
@@ -228,21 +231,36 @@
         rpcClient.getOptions().setAction("urn:listAvailableBook");
         OMElement elemnt = rpcClient.invokeBlocking(new QName("http://servicelifecycle.sample/xsd",
                 "listAvailableBook"), new Object[]{null});
-        System.out.println(elemnt);
+        printBookData(elemnt);
+    }
+
+    private void printBookData(OMElement element) throws Exception {
+        if (element != null) {
+            Iterator values = element.getChildrenWithName(new QName("http://servicelifecycle.sample/xsd",
"return"));
+            while (values.hasNext()) {
+                OMElement omElement = (OMElement) values.next();
+                Book book = (Book) BeanUtil.deserialize(Book.class, omElement, new DefaultObjectSupplier(),
"book");
+                System.out.println("Isbn : " + book.getIsbn());
+                System.out.println("Author : " + book.getAuthor());
+                System.out.println("Title : " + book.getTitle());
+                System.out.println("");
+            }
+
+        }
     }
 
     public void listAllBook(RPCServiceClient rpcClient) throws Exception {
         rpcClient.getOptions().setAction("urn:listAllBook");
         OMElement elemnt = rpcClient.invokeBlocking(new QName("http://servicelifecycle.sample/xsd",
                 "listAllBook"), new Object[]{null});
-        System.out.println(elemnt);
+        printBookData(elemnt);
     }
 
     public void listLendBook(RPCServiceClient rpcClient) throws Exception {
         rpcClient.getOptions().setAction("urn:listLendBook");
         OMElement elemnt = rpcClient.invokeBlocking(new QName("http://servicelifecycle.sample/xsd",
                 "listLendBook"), new Object[]{null});
-        System.out.println(elemnt);
+        printBookData(elemnt);
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message