You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by mm...@apache.org on 2005/02/04 02:27:11 UTC

svn commit: r151283 - in incubator/beehive/trunk/samples/wsm-addressbook/WEB-INF/src: org/apache/beehive/sample/AddressBookImpl.java web/Service.jws

Author: mmerz
Date: Thu Feb  3 17:27:09 2005
New Revision: 151283

URL: http://svn.apache.org/viewcvs?view=rev&rev=151283
Log:
Fixed the service name and made map static

Contributor: Daryoush Mehrtash

Modified:
    incubator/beehive/trunk/samples/wsm-addressbook/WEB-INF/src/org/apache/beehive/sample/AddressBookImpl.java
    incubator/beehive/trunk/samples/wsm-addressbook/WEB-INF/src/web/Service.jws

Modified: incubator/beehive/trunk/samples/wsm-addressbook/WEB-INF/src/org/apache/beehive/sample/AddressBookImpl.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-addressbook/WEB-INF/src/org/apache/beehive/sample/AddressBookImpl.java?view=diff&r1=151282&r2=151283
==============================================================================
--- incubator/beehive/trunk/samples/wsm-addressbook/WEB-INF/src/org/apache/beehive/sample/AddressBookImpl.java (original)
+++ incubator/beehive/trunk/samples/wsm-addressbook/WEB-INF/src/org/apache/beehive/sample/AddressBookImpl.java Thu Feb  3 17:27:09 2005
@@ -24,17 +24,21 @@
 
 public class AddressBookImpl implements AddressBook
 {
-    private Map<String, Address> addresses = new Hashtable<String, Address>();
+    private static Map<String, Address> addresses = new Hashtable<String, Address>();
 
     public void addEntry(String name, Address address)
     {
-        System.out.println("addEntry is called." );
+        System.out.println("addEntry is called for: " + name );
         this.addresses.put(name, address);
     }
     
     public Address getAddressFromName(String name) 
     {
-        System.out.println("getAddressFromName is called.");
-        return (Address) this.addresses.get(name);
+      System.out.println("getAddressFromName is called for: " + name);
+      Address res = (Address) this.addresses.get(name);
+      if( null == res) System.out.println("No address was found!");
+      else System.out.println("Address: city: " + res.getCity() + " zipcode: " + res.getZip());
+         
+      return res;
     }
 }

Modified: incubator/beehive/trunk/samples/wsm-addressbook/WEB-INF/src/web/Service.jws
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-addressbook/WEB-INF/src/web/Service.jws?view=diff&r1=151282&r2=151283
==============================================================================
--- incubator/beehive/trunk/samples/wsm-addressbook/WEB-INF/src/web/Service.jws (original)
+++ incubator/beehive/trunk/samples/wsm-addressbook/WEB-INF/src/web/Service.jws Thu Feb  3 17:27:09 2005
@@ -29,7 +29,7 @@
 import org.apache.beehive.sample.AddressBookImpl;
 
 
-@WebService(targetNamespace="http://beehive.apache.org/AddressBook")
+@WebService(targetNamespace="http://beehive.apache.org/addressbook", serviceName="SimpleAddressBook")
 public class Service implements AddressBook {
 
     AddressBook addressBook;
@@ -61,36 +61,7 @@
         return addressBook.getAddressFromName(name);
     }
     
-    @WebMethod
-    public Address[] getAddressFromNames(String[] name) {
-    	if(null == name) return null;
-    	Address[] result = new Address[name.length];
-    	for(int i=0; i< name.length; i++) {
-    	 result[i] = addressBook.getAddressFromName(name[i]);
-    	}
-    	return result;
-    }    
-    
-    @WebMethod
-    @Oneway
-    public void oneWayWithParam(String param1) {
-    	return;
-    }
-    
-    
-     @WebMethod
-    @Oneway
-    public void oneWayWithNoParam() {
-    	return;
-    }
-    
-    
-    
-    @WebMethod
-    public String simpleNoParamMethod () {
-    	return "No Param method";
-    }
-    
+ 
     /**
      * This method is not exposed by the Web Service and can only be used
      * locally.