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 2004/11/01 21:06:29 UTC
svn commit: rev 56275 - in incubator/beehive/branches/v1/alpha/samples/AddressBookWS: . WEB-INF WEB-INF/src/org/apache/beehive/demo WEB-INF/src/org/apache/beehive/sample WEB-INF/src/web
Author: mmerz
Date: Mon Nov 1 12:06:26 2004
New Revision: 56275
Added:
incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/build.xml
- copied, changed from rev 56252, incubator/beehive/branches/v1/alpha/samples/AddressBookWS/build.xml
incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/src/org/apache/beehive/sample/
- copied from rev 56266, incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/src/org/apache/beehive/demo/
incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/src/web/
incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/src/web/Service.jws
Removed:
incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/src/org/apache/beehive/demo/
incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/src/org/apache/beehive/sample/AddressBookService.java
incubator/beehive/branches/v1/alpha/samples/AddressBookWS/build.xml
Modified:
incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/src/org/apache/beehive/sample/AddressBook.java
incubator/beehive/branches/v1/alpha/samples/AddressBookWS/index.html
Log:
Cleaned up and finalized AddressBook sample.
Copied: incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/build.xml (from rev 56252, incubator/beehive/branches/v1/alpha/samples/AddressBookWS/build.xml)
==============================================================================
--- incubator/beehive/branches/v1/alpha/samples/AddressBookWS/build.xml (original)
+++ incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/build.xml Mon Nov 1 12:06:26 2004
@@ -1,88 +1,80 @@
<?xml version="1.0" ?>
-<!--
- 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:$
+<!--
+ 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:$
-->
<project name="AddressBookWS" default="build" basedir=".">
- <property environment="env" />
-
- <property name="build.dir" location="build" />
- <property name="src.dir" location="./WEB-INF/src" />
- <property name="classes.dir" location="${build.dir}/classes" />
-
- <condition property="isJDK15">
- <equals arg1="${ant.java.version}" arg2="1.5" />
- </condition>
-
- <path id="jars">
- <fileset dir="./WEB-INF/lib/">
- <include name="**/*.jar" />
- </fileset>
- </path>
-
-
-
-
- <!-- ========================================= -->
- <!-- build - build jar-file -->
- <!-- ========================================= -->
-
- <target name="build" depends="compile">
- <jar jarfile="./WEB-INF/lib/AddressBookWS.jar">
- <fileset dir="${classes.dir}" />
- </jar>
- </target>
-
-
-
-
-
- <!-- ========================================= -->
- <!-- compile - compile sources -->
- <!-- ========================================= -->
-
- <target name="compile" depends="dirs" if="isJDK15">
- <javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="jars" failonerror="true" />
- </target>
-
-
-
-
- <!-- ========================================= -->
- <!-- dirs - create dirs required for compile -->
- <!-- ========================================= -->
-
- <target name="dirs">
- <mkdir dir="${classes.dir}" />
-
- </target>
-
-
- <!-- ========================================= -->
- <!-- clean - remove build files -->
- <!-- ========================================= -->
-
- <target name="clean">
- <delete dir="${build.dir}" />
- <delete file="./WEB-INF/lib/AddressBookWS.jar" />
- </target>
-
+ <property environment="env" />
+ <property name="build.dir" location="build" />
+ <property name="src.dir" location="src" />
+ <property name="lib.dir" location="lib" />
+ <property name="jars.dir" location="${build.dir}/jars" />
+ <property name="classes.dir" location="${build.dir}/classes" />
+
+ <condition property="isJDK15">
+ <equals arg1="${ant.java.version}" arg2="1.5" />
+ </condition>
+
+ <path id="jars">
+ <fileset dir="${lib.dir}/">
+ <include name="**/*.jar" />
+ </fileset>
+ </path>
+
+
+ <!-- ========================================= -->
+ <!-- build - build jar-file -->
+ <!-- ========================================= -->
+
+ <target name="build" depends="compile">
+ <jar jarfile="${jars.dir}/AddressBookWS.jar">
+ <fileset dir="${classes.dir}" />
+ </jar>
+ </target>
+
+
+ <!-- ========================================= -->
+ <!-- compile - compile sources -->
+ <!-- ========================================= -->
+
+ <target name="compile" depends="dirs" if="isJDK15">
+ <javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="jars" failonerror="true" />
+ </target>
+
+
+ <!-- ========================================= -->
+ <!-- dirs - create dirs required for compile -->
+ <!-- ========================================= -->
+
+ <target name="dirs">
+ <mkdir dir="${classes.dir}" />
+ <mkdir dir="${jars.dir}" />
+ </target>
+
+
+ <!-- ========================================= -->
+ <!-- clean - remove build files -->
+ <!-- ========================================= -->
+
+ <target name="clean">
+ <delete dir="${build.dir}" />
+ </target>
</project>
Modified: incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/src/org/apache/beehive/sample/AddressBook.java
==============================================================================
--- incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/src/org/apache/beehive/demo/AddressBook.java (original)
+++ incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/src/org/apache/beehive/sample/AddressBook.java Mon Nov 1 12:06:26 2004
@@ -18,13 +18,9 @@
* $Header:$
*/
-import java.rmi.Remote;
-
-public interface AddressBook extends Remote
+public interface AddressBook
{
- void addEntry(java.lang.String name, Address address)
- throws java.rmi.RemoteException;
+ void addEntry(java.lang.String name, Address address);
- Address getAddressFromName(java.lang.String name)
- throws java.rmi.RemoteException;
+ Address getAddressFromName(java.lang.String name);
}
Added: incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/src/web/Service.jws
==============================================================================
--- (empty file)
+++ incubator/beehive/branches/v1/alpha/samples/AddressBookWS/WEB-INF/src/web/Service.jws Mon Nov 1 12:06:26 2004
@@ -0,0 +1,72 @@
+package web;
+
+/*
+ * 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:$
+ */
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+
+import org.apache.beehive.sample.Address;
+import org.apache.beehive.sample.AddressBook;
+import org.apache.beehive.sample.AddressBookImpl;
+
+
+@WebService(targetNamespace="http://www.beehive.apache.com/AddressBook")
+public class Service implements AddressBook {
+
+ AddressBook addressBook;
+
+ /**
+ * Constructor.
+ */
+ public Service() {
+ addressBook = new AddressBookImpl();
+ }
+
+ /**
+ * Web method that adds an entry to the AddressBook.
+ * @param name
+ * @param address
+ */
+ @WebMethod
+ public void addEntry(String name, Address address) {
+ addressBook.addEntry(name, address);
+ }
+
+ /**
+ * Web method that queries the AddressBook.
+ * @param name
+ * @return
+ */
+ @WebMethod
+ public Address getAddressFromName(String name) {
+ return addressBook.getAddressFromName(name);
+ }
+
+ /**
+ * This method is not exposed by the Web Service and can only be used
+ * locally.
+ * @return A random string.
+ */
+ public String notWebService() {
+ return "Not available through Web service";
+ }
+}
Modified: incubator/beehive/branches/v1/alpha/samples/AddressBookWS/index.html
==============================================================================
--- incubator/beehive/branches/v1/alpha/samples/AddressBookWS/index.html (original)
+++ incubator/beehive/branches/v1/alpha/samples/AddressBookWS/index.html Mon Nov 1 12:06:26 2004
@@ -17,7 +17,7 @@
</li>
<li>
View AddressBook Web Service's
- <a href="AddressBookWebService.jws?wsdl">WSDL</a>
+ <a href="web/Service.jws?wsdl">WSDL</a>
</li>
</ul>