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/01 19:23:21 UTC
svn commit: r149428 - in
incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF: ./
src/org/apache/beehive/sample/ src/web/
Author: mmerz
Date: Tue Feb 1 10:23:16 2005
New Revision: 149428
URL: http://svn.apache.org/viewcvs?view=rev&rev=149428
Log:
added exception to the address book sample
Contributor: Daryoush Mehrtash
Added:
incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/InvalidAddressException.java
incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/InvalidNameException.java
Modified:
incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/build.xml
incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/client-build.xml
incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/AddressBookImpl.java
incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/EnhancedAddressBook.java
incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/web/Service.jws
Modified: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/build.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/build.xml?view=diff&r1=149427&r2=149428
==============================================================================
--- incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/build.xml (original)
+++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/build.xml Tue Feb 1 10:23:16 2005
@@ -53,7 +53,8 @@
<!-- ========================================= -->
- <target name="compile" depends="update_jars, dirs" if="isJDK15" >
+ <!-- <target name="compile" depends="update_jars, dirs" if="isJDK15" > -->
+ <target name="compile" depends="dirs" if="isJDK15" >
<taskdef name="apt" classname="org.apache.beehive.controls.runtime.generator.AptTask" classpath="lib/controls.jar" onerror="report" />
<apt srcdir="./src" destdir="${classes.dir}" gendir="${gen.dir}" compileByExtension="true"
Modified: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/client-build.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/client-build.xml?view=diff&r1=149427&r2=149428
==============================================================================
--- incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/client-build.xml (original)
+++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/client-build.xml Tue Feb 1 10:23:16 2005
@@ -3,7 +3,7 @@
<project name="AddressBookClient" basedir="." default="all">
<property name="AddressBook.wsdl.url"
- value="http://localhost:8080/AddressBook/web/Service.jws?wsdl" />
+ value="http://localhost:8080/EnhancedAddressBook/web/Service.jws?wsdl" />
<path id="jars">
Modified: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/AddressBookImpl.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/AddressBookImpl.java?view=diff&r1=149427&r2=149428
==============================================================================
--- incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/AddressBookImpl.java (original)
+++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/AddressBookImpl.java Tue Feb 1 10:23:16 2005
@@ -22,24 +22,26 @@
import java.util.Hashtable;
import java.util.Map;
+import javax.xml.rpc.holders.CalendarHolder;
+
public class AddressBookImpl implements EnhancedAddressBook
{
private Map<String, Address> addresses = new Hashtable<String, Address>();
- public void addEntry(String name, Address address)
+ public void addEntry(String name, Address address) throws InvalidNameException, InvalidAddressException
{
System.out.println("addEntry is called." );
this.addresses.put(name, address);
}
- public Address getAddressFromName(String name)
+ public Address getAddressFromName(String name) throws InvalidNameException
{
System.out.println("getAddressFromName is called.");
return (Address) this.addresses.get(name);
}
- public Address[] getAddressFromNames(String[] name) {
+ public Address[] getAddressFromNames(String[] name) throws InvalidNameException{
if(null == name) return null;
Address[] result = new Address[name.length];
for(int i=0; i< name.length; i++) {
@@ -47,11 +49,7 @@
}
return result;
}
-
- public void oneWayWithParam(String param1) {
- return;
- }
public void oneWayWithNoParam() {
return;
@@ -64,6 +62,10 @@
public String notWebService() {
return "Not available through Web service";
+ }
+
+ public String oneINOUTParamMethod(CalendarHolder calendar) {
+ return null;
}
}
Modified: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/EnhancedAddressBook.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/EnhancedAddressBook.java?view=diff&r1=149427&r2=149428
==============================================================================
--- incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/EnhancedAddressBook.java (original)
+++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/EnhancedAddressBook.java Tue Feb 1 10:23:16 2005
@@ -17,15 +17,16 @@
*
* $Header:$
*/
-
+import javax.xml.rpc.holders.StringHolder;
+import javax.xml.rpc.holders.CalendarHolder;
public interface EnhancedAddressBook
{
- void addEntry(java.lang.String name, Address address);
- Address getAddressFromName(java.lang.String name);
- public Address[] getAddressFromNames(String[] name) ;
- public void oneWayWithParam(String param1) ;
- public void oneWayWithNoParam();
+ void addEntry(java.lang.String name, Address address)throws InvalidNameException, InvalidAddressException;
+ Address getAddressFromName(java.lang.String name)throws InvalidNameException;
+ public Address[] getAddressFromNames(String[] name) throws InvalidNameException;
+ public void oneWayWithNoParam();
public String simpleNoParamMethod ();
+ public String oneINOUTParamMethod (CalendarHolder calendar);
/**
* This method is not exposed by the Web Service and can only be used
Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/InvalidAddressException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/InvalidAddressException.java?view=auto&rev=149428
==============================================================================
--- incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/InvalidAddressException.java (added)
+++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/InvalidAddressException.java Tue Feb 1 10:23:16 2005
@@ -0,0 +1,23 @@
+/*
+ * Copyright 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.sample;
+
+
+public class InvalidAddressException extends Exception {
+
+}
Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/InvalidNameException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/InvalidNameException.java?view=auto&rev=149428
==============================================================================
--- incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/InvalidNameException.java (added)
+++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/InvalidNameException.java Tue Feb 1 10:23:16 2005
@@ -0,0 +1,24 @@
+/*
+ * Copyright 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.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.sample;
+
+
+public class InvalidNameException extends Exception {
+
+}
Modified: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/web/Service.jws
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/web/Service.jws?view=diff&r1=149427&r2=149428
==============================================================================
--- incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/web/Service.jws (original)
+++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/web/Service.jws Tue Feb 1 10:23:16 2005
@@ -27,9 +27,14 @@
import org.apache.beehive.sample.Address;
import org.apache.beehive.sample.EnhancedAddressBook;
import org.apache.beehive.sample.AddressBookImpl;
+import org.apache.beehive.sample.InvalidAddressException;
+import org.apache.beehive.sample.InvalidNameException;
+import javax.xml.rpc.holders.StringHolder;
+import javax.xml.rpc.holders.CalendarHolder;
-@WebService(targetNamespace="http://beehive.apache.org/AddressBook2")
+
+@WebService(targetNamespace="http://beehive.apache.org/EnhancedAddressBook")
public class Service implements EnhancedAddressBook {
EnhancedAddressBook addressBook;
@@ -48,7 +53,8 @@
*/
@WebMethod
public void addEntry(@WebParam (name="name")String name,
- @WebParam (name="address")Address address) {
+ @WebParam (name="address")Address address)
+ throws InvalidNameException, InvalidAddressException{
addressBook.addEntry(name, address);
}
@@ -58,20 +64,18 @@
* @return
*/
@WebMethod
- public Address getAddressFromName(@WebParam (name="name")String name) {
+ public Address getAddressFromName(@WebParam (name="name" )String name)
+ throws InvalidNameException {
return addressBook.getAddressFromName(name);
}
@WebMethod
- public Address[] getAddressFromNames(@WebParam (name="name")String[] name) {
- return addressBook. getAddressFromNames(name);
+ public Address[] getAddressFromNames(@WebParam (name="name")String[] name)
+ throws InvalidNameException{
+ return addressBook.getAddressFromNames(name);
}
- @WebMethod
- @Oneway
- public void oneWayWithParam(@WebParam (name="firstParam")String param1) {
- addressBook.oneWayWithParam(param1);
- }
+
@WebMethod
@@ -85,6 +89,11 @@
@WebMethod
public String simpleNoParamMethod () {
return "No Param method";
+ }
+
+ @WebMethod
+ public String oneINOUTParamMethod (@WebParam (name="calendar", mode=WebParam.Mode.INOUT )CalendarHolder calendar) {
+ return addressBook.oneINOUTParamMethod(calendar);
}
/**