You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2006/10/30 11:54:01 UTC

svn commit: r469113 [1/2] - in /webservices/axis2/branches/java/1_1/modules/samples/pojo: ./ src/META-INF/ src/address_book_client/ src/address_book_entry/ src/address_book_service/ src/sample/ src/sample/addressbook/ src/sample/addressbook/adbclient/ ...

Author: sanka
Date: Mon Oct 30 02:53:59 2006
New Revision: 469113

URL: http://svn.apache.org/viewvc?view=rev&rev=469113
Log:
Renamed the packages according the guidelines


Added:
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/adbclient/
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/adbclient/AdressBookADBClient.java
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/entry/
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/entry/Entry.java
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/rpcclient/
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/rpcclient/AddressBookClient.java
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/service/
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/service/AddressBookService.java
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/stub/
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/stub/AdressBookServiceCallbackHandler.java
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/stub/AdressBookServiceStub.java
Removed:
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/address_book_client/
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/address_book_entry/
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/address_book_service/
Modified:
    webservices/axis2/branches/java/1_1/modules/samples/pojo/build.xml
    webservices/axis2/branches/java/1_1/modules/samples/pojo/src/META-INF/services.xml

Modified: webservices/axis2/branches/java/1_1/modules/samples/pojo/build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/pojo/build.xml?view=diff&rev=469113&r1=469112&r2=469113
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/pojo/build.xml (original)
+++ webservices/axis2/branches/java/1_1/modules/samples/pojo/build.xml Mon Oct 30 02:53:59 2006
@@ -1,15 +1,15 @@
 <project basedir="." default="build">
 
-	<property environment="env" />
-
-	<property name="dest.dir" value="target" />
+	<property name="dest.dir" value="build" />
 
 	<property name="dest.dir.classes" value="${dest.dir}/classes" />
 
 	<property name="dest.dir.lib" value="${dest.dir}/lib" />
 
+	<property name="axis2.home" value="../../../" />
+	
 	<path id="build.class.path">
-		<fileset dir="${env.AXIS2_HOME}/lib">
+		<fileset dir="${axis2.home}">
 			<include name="*.jar" />
 		</fileset>
 	</path>
@@ -37,7 +37,7 @@
 
 		<copy file="src/META-INF/services.xml" tofile="${dest.dir.classes}/META-INF/services.xml" overwrite="true" />
 
-		<javac srcdir="src" destdir="${dest.dir.classes}" includes="address_book_service/**,address_book_entry/**">
+		<javac srcdir="src" destdir="${dest.dir.classes}" includes="sample.addressbook.service/**,sample.addressbook.entry/**">
 			<classpath refid="build.class.path" />
 		</javac>
 

Modified: webservices/axis2/branches/java/1_1/modules/samples/pojo/src/META-INF/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/pojo/src/META-INF/services.xml?view=diff&rev=469113&r1=469112&r2=469113
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/pojo/src/META-INF/services.xml (original)
+++ webservices/axis2/branches/java/1_1/modules/samples/pojo/src/META-INF/services.xml Mon Oct 30 02:53:59 2006
@@ -1,5 +1,5 @@
 <service name="AddressBookService" scope="application">
-    <parameter name="ServiceClass" locked="false">address_book_service.AddressBookService</parameter>
+    <parameter name="ServiceClass" locked="false">sample.addressbook.service.AddressBookService</parameter>
     <operation name="addEntry">
         <actionMapping>urn:addEntry</actionMapping>
         <messageReceiver class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>

Added: webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/adbclient/AdressBookADBClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/adbclient/AdressBookADBClient.java?view=auto&rev=469113
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/adbclient/AdressBookADBClient.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/adbclient/AdressBookADBClient.java Mon Oct 30 02:53:59 2006
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed 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 sample.addressbook.adbclient;
+
+import sample.addressbook.stub.AdressBookServiceStub;
+
+public class AdressBookADBClient {
+
+    private static String URL = "http://127.0.0.1:8080/axis2/services/AdressBookService";
+
+    public static void main(String[] args) {
+
+        try {
+
+            if (args != null && args.length != 0) {
+                AdressBookServiceStub stub = new AdressBookServiceStub(args[0]);
+            } else {
+                
+            }
+
+        } catch (Exception ex) {
+
+        }
+    }
+
+}

Added: webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/entry/Entry.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/entry/Entry.java?view=auto&rev=469113
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/entry/Entry.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/entry/Entry.java Mon Oct 30 02:53:59 2006
@@ -0,0 +1,70 @@
+package sample.addressbook.entry;
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.
+ */
+
+public class Entry {
+    
+    private String name = null;
+    
+    private String street = null;
+    
+    private String city = null;
+    
+    private String state = null;
+    
+    private String postalCode = null;
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPostalCode() {
+        return postalCode;
+    }
+
+    public void setPostalCode(String postalCode) {
+        this.postalCode = postalCode;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getStreet() {
+        return street;
+    }
+
+    public void setStreet(String street) {
+        this.street = street;
+    }
+    
+}

Added: webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/rpcclient/AddressBookClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/rpcclient/AddressBookClient.java?view=auto&rev=469113
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/rpcclient/AddressBookClient.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/rpcclient/AddressBookClient.java Mon Oct 30 02:53:59 2006
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed 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 sample.addressbook.rpcclient;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.rpc.client.RPCServiceClient;
+
+import sample.addressbook.entry.Entry;
+
+
+
+public class AddressBookClient {
+
+    public static void main(String[] args1) throws AxisFault {
+
+        RPCServiceClient serviceClient = new RPCServiceClient();
+
+        Options options = serviceClient.getOptions();
+
+        EndpointReference targetEPR = new EndpointReference(
+                "http://127.0.0.1:8080/axis2/services/AdressBookService");
+        options.setTo(targetEPR);
+
+        // /////////////////////////////////////////////////////////////////////
+
+        /*
+         * Creates an Entry and stores it in the AddressBook.
+         */
+
+        // QName of the target method 
+        QName opAddEntry = new QName("http://address_book_service/xsd", "addEntry");
+
+        /*
+         * Constructing a new Entry
+         */
+        Entry entry = new Entry();
+
+        entry.setName("Abby Cadabby");
+        entry.setStreet("Sesame Street");
+        entry.setCity("Sesame City");
+        entry.setState("Sesame State");
+        entry.setPostalCode("11111");
+
+        // Constructing the arguments array for the method invocation
+        Object[] opAddEntryArgs = new Object[] { entry };
+
+        // Invoking the method
+        serviceClient.invokeRobust(opAddEntry, opAddEntryArgs);
+
+        ////////////////////////////////////////////////////////////////////////
+        
+        
+        ///////////////////////////////////////////////////////////////////////
+        
+        /*
+         * Fetching an Entry from the Address book
+         */
+        
+        // QName of the method to invoke 
+        QName opFindEntry = new QName("http://address_book_service/xsd", "findEntry");
+
+        //
+        String name = "Abby Cadabby";
+
+        Object[] opFindEntryArgs = new Object[] { name };
+        Class[] returnTypes = new Class[] { Entry.class };
+
+        
+        Object[] response = serviceClient.invokeBlocking(opFindEntry,
+                opFindEntryArgs, returnTypes);
+        
+        Entry result = (Entry) response[0];
+        
+        if (result == null) {
+            System.out.println("No entry found for " + name);
+            return;
+        } 
+        
+        System.out.println("Name   :" + result.getName());
+        System.out.println("Street :" + result.getStreet());
+        System.out.println("City   :" + result.getCity());
+        System.out.println("State  :" + result.getState());
+        System.out.println("Postal Code :" + result.getPostalCode());
+        
+
+        ///////////////////////////////////////////////////////////////////////
+    }
+}

Added: webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/service/AddressBookService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/service/AddressBookService.java?view=auto&rev=469113
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/service/AddressBookService.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/service/AddressBookService.java Mon Oct 30 02:53:59 2006
@@ -0,0 +1,31 @@
+package sample.addressbook.service;
+
+
+import java.util.HashMap;
+
+import sample.addressbook.entry.Entry;
+
+
+
+public class AddressBookService {
+    
+    private HashMap entries = new HashMap();
+
+    /**
+     * Add an Entry to the Address Book
+     * @param entry
+     */
+    public void addEntry(Entry entry) {
+        this.entries.put(entry.getName(), entry);
+    }
+    
+    /**
+     * Search an address of a person
+     * 
+     * @param name the name of the person whose address needs to be found
+     * @return return the address entry of the person. 
+     */
+    public Entry findEntry(String name) {
+        return (Entry) this.entries.get(name);
+    }
+}

Added: webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/stub/AdressBookServiceCallbackHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/stub/AdressBookServiceCallbackHandler.java?view=auto&rev=469113
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/stub/AdressBookServiceCallbackHandler.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/pojo/src/sample/addressbook/stub/AdressBookServiceCallbackHandler.java Mon Oct 30 02:53:59 2006
@@ -0,0 +1,81 @@
+
+    /**
+     * AdressBookServiceCallbackHandler.java
+     *
+     * This file was auto-generated from WSDL
+     * by the Apache Axis2 version: #axisVersion# #today#
+     */
+    package sample.addressbook.stub;
+
+    /**
+     *  AdressBookServiceCallbackHandler Callback class, Users can extend this class and implement
+     *  their own receiveResult and receiveError methods.
+     */
+    public abstract class AdressBookServiceCallbackHandler{
+
+
+
+    protected Object clientData;
+
+    /**
+    * User can pass in any object that needs to be accessed once the NonBlocking
+    * Web service call is finished and appropriate method of this CallBack is called.
+    * @param clientData Object mechanism by which the user can pass in user data
+    * that will be avilable at the time this callback is called.
+    */
+    public AdressBookServiceCallbackHandler(Object clientData){
+        this.clientData = clientData;
+    }
+    
+    
+
+    /**
+    * Please use this constructor if you don't want to set any clientData
+    */
+    public AdressBookServiceCallbackHandler(){
+        this.clientData = null;
+    }
+
+    /**
+     * Get the client data
+     */
+
+     public Object getClientData() {
+        return clientData;
+     }
+
+        
+           /**
+            * auto generated Axis2 call back method for addEntry method
+            *
+            */
+           public void receiveResultaddEntry(
+                    ) {
+           }
+
+          /**
+           * auto generated Axis2 Error handler
+           *
+           */
+            public void receiveErroraddEntry(java.lang.Exception e) {
+            }
+                
+           /**
+            * auto generated Axis2 call back method for findEntry method
+            *
+            */
+           public void receiveResultfindEntry(
+                    sample.addressbook.stub.AdressBookServiceStub.FindEntryResponse param3) {
+           }
+
+          /**
+           * auto generated Axis2 Error handler
+           *
+           */
+            public void receiveErrorfindEntry(java.lang.Exception e) {
+            }
+                
+
+
+    }
+    
\ No newline at end of file



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