Author: mmerz Date: Mon Jan 10 15:06:00 2005 New Revision: 124839 URL: http://svn.apache.org/viewcvs?view=rev&rev=124839 Log: Added Enhanced version of the address book with additional methods and types.
Contributor: Daryoush Mehrtash Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/ incubator/beehive/trunk/samples/EnhancedAddressBookWS/.classpath incubator/beehive/trunk/samples/EnhancedAddressBookWS/.project incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/attachments/ 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/logs/ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/logs/TEST-org.apache.beehive.AddressBook.ServiceServiceTestCase.txt incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/server-config.wsdd incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/log4j.properties incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/Address.java 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/org/apache/beehive/sample/Phone.java incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/StateType.java incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/web/ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/web/Service.jws incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/tryclient-build.xml incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/web.xml incubator/beehive/trunk/samples/EnhancedAddressBookWS/bin/ incubator/beehive/trunk/samples/EnhancedAddressBookWS/happyaxis.jsp incubator/beehive/trunk/samples/EnhancedAddressBookWS/index.html Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/.classpath Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/.classpath?view=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/.classpath Mon Jan 10 15:06:00 2005 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="WEB-INF/src"/> + <classpathentry kind="lib" path="WEB-INF/lib/AddressBookWS.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/apache-xbean.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/axis.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/axis-ant.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/commons-discovery.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/commons-logging.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/controls.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/jaxrpc.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/log4j-1.2.8.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/saaj.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/velocity-1.4.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/velocity-dep-1.4.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/wsdl4j.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/wsdltypes.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/wsm.jar"/> + <classpathentry kind="lib" path="WEB-INF/lib/wsm-axis.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/.project Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/.project?view=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/.project Mon Jan 10 15:06:00 2005 @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ADDRESSBOOK_SAMPLE</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: 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=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/build.xml Mon Jan 10 15:06:00 2005 @@ -0,0 +1,125 @@ +<?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:$ + --> + +<project name="EnhancedAddressBookWS" default="build" basedir="."> + + <property environment="env" /> + + <property name="build.dir" location="build" /> + <property name="gen.dir" location="${build.dir}/gen" /> + <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" > + <include name="**/*.jar" /> + </fileset> + </path> + + + <!-- ========================================= --> + <!-- build - build jar-file --> + <!-- ========================================= --> + + <target name="build" depends="compile"> + <jar jarfile="./lib/EnhancedAddressBookWS.jar"> + <fileset dir="${classes.dir}" /> + </jar> + </target> + + + <!-- ========================================= --> + <!-- compile - compile sources --> + <!-- ========================================= --> + + + <target name="compile" depends="update_jars, 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" + classpathref="jars" srcExtensions="*.java,*.jcx,*.jcs,*.jws" > + + </apt> + + </target> + + <target name="update_jars" > + <property name="log4j.jar" location="${env.BEEHIVE_HOME}/external/log4j/log4j-1.2.8.jar" /> + <property name="junit.jar" location="${env.BEEHIVE_HOME}/external/junit/junit.jar" /> + <property name="velocity14.jar" location="${env.BEEHIVE_HOME}/external/velocity/velocity-1.4.jar" /> + <property name="velocitydep14.jar" location="${env.BEEHIVE_HOME}/external/velocity/velocity-dep-1.4.jar" /> + <property name="derby.jar" location="${env.BEEHIVE_HOME}/external/derby/derby_46005.jar" /> + <property name="xbean.jar" location="${env.BEEHIVE_HOME}/external/xmlbeans/apache-xbean.jar" /> + + <copy todir="lib" > + <fileset file="${log4j.jar}"/> + <fileset file="${xbean.jar}"/> + + <!-- these are required by Controls and WSM --> + <fileset file="${velocity14.jar}" /> + <fileset file="${velocitydep14.jar}"/> + <fileset dir="${env.BEEHIVE_HOME}/wsm/lib"> + <include name="wsdltypes.jar"/> + </fileset> + + <fileset dir="${env.BEEHIVE_HOME}/wsm/external"> + <include name="axis.jar"/> + <include name="axis-ant.jar"/> + <include name="jaxrpc.jar"/> + <include name="saaj.jar"/> + <include name="wsdl4j.jar"/> + <include name="commons-discovery.jar"/> + </fileset> + + <fileset dir="${env.BEEHIVE_HOME}/wsm/build/jars"> + <include name="wsm.jar"/> + <include name="wsm-axis.jar"/> + </fileset> + <fileset dir="${env.BEEHIVE_HOME}/controls/build/jars"> + <include name="controls.jar"/> + </fileset> + </copy> + </target> + + <!-- ========================================= --> + <!-- dirs - create dirs required for compile --> + <!-- ========================================= --> + + <target name="dirs"> + <mkdir dir="${classes.dir}" /> + <mkdir dir="${gen.dir}" /> + </target> + + + <!-- ========================================= --> + <!-- clean - remove build files --> + <!-- ========================================= --> + + <target name="clean" > + <delete file="velocity.log" /> + <delete file="./lib/EnhancedAddressBookWS.jar" /> + <delete dir="${build.dir}" /> + <delete dir="${gen.dir}" /> + </target> + +</project> \ No newline at end of file Added: 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=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/client-build.xml Mon Jan 10 15:06:00 2005 @@ -0,0 +1,69 @@ +<?xml version="1.0" ?> + +<project name="AddressBookClient" basedir="." default="all"> + + <property name="AddressBook.wsdl.url" + value="http://localhost:8080/AddressBook/web/Service.jws?wsdl" /> + + + <path id="jars"> + <fileset dir="lib"> + <include name="**/*.jar"/> + </fileset> + </path> + + <taskdef name="wsdl2java" classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask" + loaderref="axis" > + <classpath refid="jars"/> + </taskdef> + + + <target name="clean"> + <delete dir="build" /> + <delete dir="./logs" /> + + </target> + + <target name="dirs"> + <mkdir dir="build" /> + <mkdir dir="build/generated" /> + <mkdir dir="build/classes" /> + <mkdir dir="./logs" /> + + </target> + <target name="all" depends="genClient, compile, test"/> + + <target name="genClient" depends="dirs"> + <wsdl2java url="${AddressBook.wsdl.url}" + output="build/generated" + testcase="yes"> + </wsdl2java> + + </target> + + <target name="compile" depends="genClient"> + <javac srcdir="build/generated" + destdir="build/classes" + classpathref="jars" + failonerror="true" + source="1.4" + /> + </target> + + <target name="test" depends="compile"> + <junit printsummary="yes" haltonfailure="yes" showoutput="yes"> + <classpath> + <pathelement location= "build/classes"/> + <path refid="jars"/> + </classpath> + <formatter type="plain"/> + <batchtest fork="yes" todir="./logs"> + <fileset dir="build/classes"> + <include name="**/*Test*.class"/> + </fileset> + </batchtest> + </junit> + + </target> + +</project> \ No newline at end of file Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/logs/TEST-org.apache.beehive.AddressBook.ServiceServiceTestCase.txt Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/logs/TEST-org.apache.beehive.AddressBook.ServiceServiceTestCase.txt?view=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/logs/TEST-org.apache.beehive.AddressBook.ServiceServiceTestCase.txt Mon Jan 10 15:06:00 2005 @@ -0,0 +1,13 @@ +Testsuite: org.apache.beehive.AddressBook.ServiceServiceTestCase +Tests run: 7, Failures: 0, Errors: 0, Time elapsed: 1.485 sec +------------- Standard Output --------------- +- Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled. +------------- ---------------- --------------- + +Testcase: testServiceWSDL took 0.938 sec +Testcase: test1ServiceOneWayWithParam took 0.187 sec +Testcase: test2ServiceGetAddressFromName took 0.266 sec +Testcase: test3ServiceOneWayWithNoParam took 0.016 sec +Testcase: test4ServiceAddEntry took 0.031 sec +Testcase: test5ServiceGetAddressFromNames took 0.016 sec +Testcase: test6ServiceSimpleNoParamMethod took 0.031 sec Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/server-config.wsdd Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/server-config.wsdd?view=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/server-config.wsdd Mon Jan 10 15:06:00 2005 @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> + <globalConfiguration> + <parameter name="adminPassword" value="admin"/> + <parameter name="disablePrettyXML" value="true"/> + <parameter name="attachments.implementation" value="org.apache.axis.attachments.AttachmentsImpl"/> + <parameter name="sendXsiTypes" value="true"/> + <parameter name="sendXMLDeclaration" value="true"/> + <requestFlow> + <handler type="java:org.apache.beehive.wsm.axis.AnnotatedWebServiceDeploymentHandler"> + <parameter name="scope" value="session"/> + </handler> + <handler type="java:org.apache.axis.handlers.JWSHandler"> + <parameter name="scope" value="session"/> + </handler> + </requestFlow> + </globalConfiguration> + <handler name="LocalResponder" type="java:org.apache.axis.transport.local.LocalResponder"/> + <handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper"/> + <handler name="Authenticate" type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/> + <service name="AdminService" provider="java:MSG"> + <parameter name="allowedMethods" value="AdminService"/> + <parameter name="enableRemoteAdmin" value="false"/> + <parameter name="className" value="org.apache.axis.utils.Admin"/> + <namespace>http://xml.apache.org/axis/wsdd/</namespace> + </service> + <service name="Version" provider="java:RPC"> + <parameter name="allowedMethods" value="getVersion"/> + <parameter name="className" value="org.apache.axis.Version"/> + </service> + <transport name="http"> + <requestFlow> + <handler type="URLMapper"/> + <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/> + </requestFlow> + <parameter name="qs:list" value="org.apache.axis.transport.http.QSListHandler"/> + <parameter name="qs:wsdl" value="org.apache.axis.transport.http.QSWSDLHandler"/> + <parameter name="qs:method" value="org.apache.axis.transport.http.QSMethodHandler"/> + </transport> + <transport name="local"> + <responseFlow> + <handler type="LocalResponder"/> + </responseFlow> + </transport> +</deployment> + Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/log4j.properties Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/log4j.properties?view=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/log4j.properties Mon Jan 10 15:06:00 2005 @@ -0,0 +1,20 @@ +# Set root category priority to INFO and its only appender to CONSOLE. +log4j.rootCategory=INFO, CONSOLE +#log4j.rootCategory=INFO, CONSOLE, LOGFILE + +# Set the enterprise logger category to FATAL and its only appender to CONSOLE. +log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE + +# CONSOLE is set to be a ConsoleAppender using a PatternLayout. +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CONSOLE.Threshold=INFO +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n + +# LOGFILE is set to be a File appender using a PatternLayout. +log4j.appender.LOGFILE=org.apache.log4j.FileAppender +log4j.appender.LOGFILE.File=axis.log +log4j.appender.LOGFILE.Append=true +log4j.appender.LOGFILE.Threshold=INFO +log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout +log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/Address.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/Address.java?view=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/Address.java Mon Jan 10 15:06:00 2005 @@ -0,0 +1,132 @@ +package org.apache.beehive.sample; + +/* + * 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 java.io.Serializable; + +public class Address implements Serializable +{ + private static final long serialVersionUID = 1L; + private int streetNum; + private java.lang.String streetName; + private java.lang.String city; + private StateType state; + private int zip; + private Phone phoneNumber; + + + + /** + * @param streetNum + * @param streetName + * @param city + * @param state + * @param zip + * @param phoneNumber + */ + public Address(int streetNum, java.lang.String streetName, + java.lang.String city, StateType state, int zip, Phone phoneNumber) { + super(); + this.streetNum = streetNum; + this.streetName = streetName; + this.city = city; + this.state = state; + this.zip = zip; + this.phoneNumber = phoneNumber; + } + /** + * + */ + public Address() { + super(); + // TODO Auto-generated constructor stub + } + /** + * @return Returns the city. + */ + public java.lang.String getCity() { + return city; + } + /** + * @param city The city to set. + */ + public void setCity(java.lang.String city) { + this.city = city; + } + /** + * @return Returns the phoneNumber. + */ + public Phone getPhoneNumber() { + return phoneNumber; + } + /** + * @param phoneNumber The phoneNumber to set. + */ + public void setPhoneNumber(Phone phoneNumber) { + this.phoneNumber = phoneNumber; + } + /** + * @return Returns the state. + */ + public StateType getState() { + return state; + } + /** + * @param state The state to set. + */ + public void setState(StateType state) { + this.state = state; + } + /** + * @return Returns the streetName. + */ + public java.lang.String getStreetName() { + return streetName; + } + /** + * @param streetName The streetName to set. + */ + public void setStreetName(java.lang.String streetName) { + this.streetName = streetName; + } + /** + * @return Returns the streetNum. + */ + public int getStreetNum() { + return streetNum; + } + /** + * @param streetNum The streetNum to set. + */ + public void setStreetNum(int streetNum) { + this.streetNum = streetNum; + } + /** + * @return Returns the zip. + */ + public int getZip() { + return zip; + } + /** + * @param zip The zip to set. + */ + public void setZip(int zip) { + this.zip = zip; + } +} Added: 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=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/AddressBookImpl.java Mon Jan 10 15:06:00 2005 @@ -0,0 +1,69 @@ +package org.apache.beehive.sample; + +/* + * 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 java.util.Hashtable; +import java.util.Map; + +public class AddressBookImpl implements EnhancedAddressBook +{ + private Map<String, Address> addresses = new Hashtable<String, Address>(); + + public void addEntry(String name, Address address) + { + System.out.println("addEntry is called." ); + this.addresses.put(name, address); + } + + public Address getAddressFromName(String name) + { + System.out.println("getAddressFromName is called."); + return (Address) this.addresses.get(name); + } + + + 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] = getAddressFromName(name[i]); + } + return result; + } + + + public void oneWayWithParam(String param1) { + return; + } + + public void oneWayWithNoParam() { + return; + } + + + public String simpleNoParamMethod () { + return "No Param method"; + } + + public String notWebService() { + return "Not available through Web service"; + } + +} Added: 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=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/EnhancedAddressBook.java Mon Jan 10 15:06:00 2005 @@ -0,0 +1,37 @@ +package org.apache.beehive.sample; + +/* + * 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:$ + */ + +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(); + public String simpleNoParamMethod (); + + /** + * This method is not exposed by the Web Service and can only be used + * locally. + * @return A random string. + */ + public String notWebService() ; + +} Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/Phone.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/Phone.java?view=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/Phone.java Mon Jan 10 15:06:00 2005 @@ -0,0 +1,88 @@ +package org.apache.beehive.sample; + +/* + * 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 java.io.Serializable; + +public class Phone implements Serializable +{ + private static final long serialVersionUID = 1L; + + private int areaCode; + private java.lang.String exchange; + private java.lang.String number; + + + + /** + * @param areaCode + * @param exchange + * @param number + */ + public Phone(int areaCode, java.lang.String exchange, + java.lang.String number) { + super(); + this.areaCode = areaCode; + this.exchange = exchange; + this.number = number; + } + /** + * + */ + public Phone() { + super(); + // TODO Auto-generated constructor stub + } + /** + * @return Returns the areaCode. + */ + public int getAreaCode() { + return areaCode; + } + /** + * @param areaCode The areaCode to set. + */ + public void setAreaCode(int areaCode) { + this.areaCode = areaCode; + } + /** + * @return Returns the exchange. + */ + public java.lang.String getExchange() { + return exchange; + } + /** + * @param exchange The exchange to set. + */ + public void setExchange(java.lang.String exchange) { + this.exchange = exchange; + } + /** + * @return Returns the number. + */ + public java.lang.String getNumber() { + return number; + } + /** + * @param number The number to set. + */ + public void setNumber(java.lang.String number) { + this.number = number; + } +} Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/StateType.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/StateType.java?view=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/org/apache/beehive/sample/StateType.java Mon Jan 10 15:06:00 2005 @@ -0,0 +1,49 @@ +package org.apache.beehive.sample; + +/* + * 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 java.io.Serializable; + +public class StateType implements Serializable +{ + private static final long serialVersionUID = 1L; + String state; + + /** + * + */ + public StateType() { + super(); + // TODO Auto-generated constructor stub + } + /** + * @param state + */ + public StateType(String state) { + super(); + this.state = state; + } + /** + * @return Returns the state. + */ + public String getState() { + return state; + } + +} Added: 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=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/src/web/Service.jws Mon Jan 10 15:06:00 2005 @@ -0,0 +1,100 @@ +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.EnhancedAddressBook; +import org.apache.beehive.sample.AddressBookImpl; + + [EMAIL PROTECTED](targetNamespace="http://beehive.apache.org/AddressBook2") +public class Service implements EnhancedAddressBook { + + EnhancedAddressBook addressBook; + + /** + * Constructor. + */ + public Service() { + addressBook = new AddressBookImpl(); + } + + /** + * Web method that adds an entry to the AddressBook. + * @param name + * @param address + */ + @WebMethod + public void addEntry(@WebParam (name="name")String name, + @WebParam (name="address")Address address) { + addressBook.addEntry(name, address); + } + + /** + * Web method that queries the AddressBook. + * @param name + * @return + */ + @WebMethod + public Address getAddressFromName(@WebParam (name="name")String name) { + return addressBook.getAddressFromName(name); + } + + @WebMethod + public Address[] getAddressFromNames(@WebParam (name="name")String[] name) { + return addressBook. getAddressFromNames(name); + } + + @WebMethod + @Oneway + public void oneWayWithParam(@WebParam (name="firstParam")String param1) { + addressBook.oneWayWithParam(param1); + } + + + @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. + * @return A random string. + */ + public String notWebService() { + return "Not available through Web service"; + } + + +} Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/tryclient-build.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/tryclient-build.xml?view=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/tryclient-build.xml Mon Jan 10 15:06:00 2005 @@ -0,0 +1,67 @@ +<?xml version="1.0" ?> + +<project name="AddressBookClient" basedir="." default="all"> + + <property name="AddressBook.wsdl.url" + value="http://localhost:8080/AddressBook/web/Service.jws?wsdl" /> + + + <path id="jars"> + <fileset dir="lib"> + <include name="**/*.jar"/> + </fileset> + </path> + + <taskdef name="wsdl2java" classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask" + loaderref="axis" > + <classpath refid="jars"/> + </taskdef> + + + <target name="clean"> + <delete dir="build" /> + </target> + + <target name="dirs"> + <mkdir dir="build" /> + <mkdir dir="build/generated" /> + <mkdir dir="build/classes" /> + + </target> + <target name="all" depends="genClient, compile, test"/> + + <target name="genClient" depends="dirs"> + <wsdl2java url="${AddressBook.wsdl.url}" + output="build/generated" + testcase="yes" serverside="true"> + </wsdl2java> + + </target> + + <target name="compile" depends="genClient"> + <javac srcdir="build/generated" + destdir="build/classes" + classpathref="jars" + failonerror="true" + source="1.4" + /> + </target> + + <target name="test" depends="compile"> + <junit printsummary="yes" haltonfailure="yes" showoutput="yes"> + <classpath> + <pathelement location= "build/classes"/> + <path refid="jars"/> + </classpath> + + + <batchtest fork="yes" todir="."> + <fileset dir="build/classes"> + <include name="**/*Test*.class"/> + </fileset> + </batchtest> + </junit> + + </target> + +</project> \ No newline at end of file Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/web.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/web.xml?view=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/WEB-INF/web.xml Mon Jan 10 15:06:00 2005 @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web +Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> + +<web-app> + + <display-name>Apache-Axis</display-name> + + <filter> + <filter-name>ControlFilter</filter-name> + <filter-class>org.apache.beehive.controls.runtime.servlet.ControlFilter</filter-class> + </filter> + + <filter-mapping> + <filter-name>ControlFilter</filter-name> + <url-pattern>*.jws</url-pattern> + </filter-mapping> + + <listener> + <listener-class>org.apache.axis.transport.http.AxisHTTPSessionListener</listener-class> + </listener> + + <servlet> + <servlet-name>AxisServlet</servlet-name> + <display-name>Apache-Axis Servlet</display-name> + <servlet-class> + org.apache.axis.transport.http.AxisServlet + </servlet-class> + </servlet> + + <servlet> + <servlet-name>AdminServlet</servlet-name> + <display-name>Axis Admin Servlet</display-name> + <servlet-class> + org.apache.axis.transport.http.AdminServlet + </servlet-class> + <load-on-startup>100</load-on-startup> + </servlet> + + <servlet> + <servlet-name>SOAPMonitorService</servlet-name> + <display-name>SOAPMonitorService</display-name> + <servlet-class> + org.apache.axis.monitor.SOAPMonitorService + </servlet-class> + <init-param> + <param-name>SOAPMonitorPort</param-name> + <param-value>5001</param-value> + </init-param> + <load-on-startup>100</load-on-startup> + </servlet> + + <servlet-mapping> + <servlet-name>AxisServlet</servlet-name> + <url-pattern>/servlet/AxisServlet</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>AxisServlet</servlet-name> + <url-pattern>*.jws</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>AxisServlet</servlet-name> + <url-pattern>/services/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>SOAPMonitorService</servlet-name> + <url-pattern>/SOAPMonitor</url-pattern> + </servlet-mapping> + + <!-- uncomment this if you want the admin servlet --> + <!-- + <servlet-mapping> + <servlet-name>AdminServlet</servlet-name> + <url-pattern>/servlet/AdminServlet</url-pattern> + </servlet-mapping> + --> + + <session-config> + <!-- Default to 5 minute session timeouts --> + <session-timeout>5</session-timeout> + </session-config> + + <!-- currently the W3C havent settled on a media type for WSDL; + http://www.w3.org/TR/2003/WD-wsdl12-20030303/#ietf-draft + for now we go with the basic 'it's XML' response --> + <mime-mapping> + <extension>wsdl</extension> + <mime-type>text/xml</mime-type> + </mime-mapping> + + + <mime-mapping> + <extension>xsd</extension> + <mime-type>text/xml</mime-type> + </mime-mapping> + + <welcome-file-list id="WelcomeFileList"> + <welcome-file>index.html</welcome-file> + <welcome-file>index.jsp</welcome-file> + <welcome-file>index.jws</welcome-file> + </welcome-file-list> + +</web-app> Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/happyaxis.jsp Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/happyaxis.jsp?view=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/happyaxis.jsp Mon Jan 10 15:06:00 2005 @@ -0,0 +1,488 @@ +<html> +<%@ page import="java.io.InputStream, + java.io.IOException, + javax.xml.parsers.SAXParser, + javax.xml.parsers.SAXParserFactory" + session="false" %> + <% + /* + * Copyright 2002,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. + */ +%> +<head> +<title>Axis Happiness Page</title> +</head> +<body bgcolor='#ffffff'> +<%! + + /* + * Happiness tests for axis. These look at the classpath and warn if things + * are missing. Normally addng this much code in a JSP page is mad + * but here we want to validate JSP compilation too, and have a drop-in + * page for easy re-use + * @author Steve 'configuration problems' Loughran + * @author dims + * @author Brian Ewins + */ + + + /** + * Get a string providing install information. + * TODO: make this platform aware and give specific hints + */ + public String getInstallHints(HttpServletRequest request) { + + String hint= + "<B><I>Note:</I></B> On Tomcat 4.x and Java1.4, you may need to put libraries that contain " + +"java.* or javax.* packages into CATALINA_HOME/common/lib" + +"<br>jaxrpc.jar and saaj.jar are two such libraries."; + return hint; + } + + /** + * test for a class existing + * @param classname + * @return class iff present + */ + Class classExists(String classname) { + try { + return Class.forName(classname); + } catch (ClassNotFoundException e) { + return null; + } + } + + /** + * test for resource on the classpath + * @param resource + * @return true iff present + */ + boolean resourceExists(String resource) { + boolean found; + InputStream instream=this.getClass().getResourceAsStream(resource); + found=instream!=null; + if(instream!=null) { + try { + instream.close(); + } catch (IOException e) { + } + } + return found; + } + + /** + * probe for a class, print an error message is missing + * @param out stream to print stuff + * @param category text like "warning" or "error" + * @param classname class to look for + * @param jarFile where this class comes from + * @param errorText extra error text + * @param homePage where to d/l the library + * @return the number of missing classes + * @throws IOException + */ + int probeClass(JspWriter out, + String category, + String classname, + String jarFile, + String description, + String errorText, + String homePage) throws IOException { + try { + Class clazz = classExists(classname); + if(clazz == null) { + String url=""; + if(homePage!=null) { + url="<br> See <a href="+homePage+">"+homePage+"</a>"; + } + out.write("<p>"+category+": could not find class "+classname + +" from file <b>"+jarFile + +"</b><br> "+errorText + +url + +"<p>"); + return 1; + } else { + String location = getLocation(out, clazz); + if(location == null) { + out.write("Found "+ description + " (" + classname + ")<br>"); + } + else { + out.write("Found "+ description + " (" + classname + ") at " + location + "<br>"); + } + return 0; + } + } catch(NoClassDefFoundError ncdfe) { + String url=""; + if(homePage!=null) { + url="<br> See <a href="+homePage+">"+homePage+"</a>"; + } + out.write("<p>"+category+": could not find a dependency" + +" of class "+classname + +" from file <b>"+jarFile + +"</b><br> "+errorText + +url + +"<br>The root cause was: "+ncdfe.getMessage() + +"<br>This can happen e.g. if "+classname+" is in" + +" the 'common' classpath, but a dependency like " + +" activation.jar is only in the webapp classpath." + +"<p>"); + return 1; + } + } + + /** + * get the location of a class + * @param out + * @param clazz + * @return the jar file or path where a class was found + */ + + String getLocation(JspWriter out, + Class clazz) { + try { + java.net.URL url = clazz.getProtectionDomain().getCodeSource().getLocation(); + String location = url.toString(); + if(location.startsWith("jar")) { + url = ((java.net.JarURLConnection)url.openConnection()).getJarFileURL(); + location = url.toString(); + } + + if(location.startsWith("file")) { + java.io.File file = new java.io.File(url.getFile()); + return file.getAbsolutePath(); + } else { + return url.toString(); + } + } catch (Throwable t){ + } + return "an unknown location"; + } + + /** + * a class we need if a class is missing + * @param out stream to print stuff + * @param classname class to look for + * @param jarFile where this class comes from + * @param errorText extra error text + * @param homePage where to d/l the library + * @throws IOException when needed + * @return the number of missing libraries (0 or 1) + */ + int needClass(JspWriter out, + String classname, + String jarFile, + String description, + String errorText, + String homePage) throws IOException { + return probeClass(out, + "<b>Error</b>", + classname, + jarFile, + description, + errorText, + homePage); + } + + /** + * print warning message if a class is missing + * @param out stream to print stuff + * @param classname class to look for + * @param jarFile where this class comes from + * @param errorText extra error text + * @param homePage where to d/l the library + * @throws IOException when needed + * @return the number of missing libraries (0 or 1) + */ + int wantClass(JspWriter out, + String classname, + String jarFile, + String description, + String errorText, + String homePage) throws IOException { + return probeClass(out, + "<b>Warning</b>", + classname, + jarFile, + description, + errorText, + homePage); + } + + /** + * probe for a resource existing, + * @param out + * @param resource + * @param errorText + * @throws Exception + */ + int wantResource(JspWriter out, + String resource, + String errorText) throws Exception { + if(!resourceExists(resource)) { + out.write("<p><b>Warning</b>: could not find resource "+resource + +"<br>" + +errorText); + return 0; + } else { + out.write("found "+resource+"<br>"); + return 1; + } + } + + + /** + * get servlet version string + * + */ + + public String getServletVersion() { + ServletContext context=getServletConfig().getServletContext(); + int major = context.getMajorVersion(); + int minor = context.getMinorVersion(); + return Integer.toString(major) + '.' + Integer.toString(minor); + } + + + + /** + * what parser are we using. + * @return the classname of the parser + */ + private String getParserName() { + SAXParser saxParser = getSAXParser(); + if (saxParser == null) { + return "Could not create an XML Parser"; + } + + // check to what is in the classname + String saxParserName = saxParser.getClass().getName(); + return saxParserName; + } + + /** + * Create a JAXP SAXParser + * @return parser or null for trouble + */ + private SAXParser getSAXParser() { + SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); + if (saxParserFactory == null) { + return null; + } + SAXParser saxParser = null; + try { + saxParser = saxParserFactory.newSAXParser(); + } catch (Exception e) { + } + return saxParser; + } + + /** + * get the location of the parser + * @return path or null for trouble in tracking it down + */ + + private String getParserLocation(JspWriter out) { + SAXParser saxParser = getSAXParser(); + if (saxParser == null) { + return null; + } + String location = getLocation(out,saxParser.getClass()); + return location; + } + %> +<html><head><title>Axis Happiness Page</title></head> +<body> +<h1>Axis Happiness Page</h1> +<h2>Examining webapp configuration</h2> + +<p> +<h3>Needed Components</h3> +<% + int needed=0,wanted=0; + + /** + * the essentials, without these Axis is not going to work + */ + needed=needClass(out, "javax.xml.soap.SOAPMessage", + "saaj.jar", + "SAAJ API", + "Axis will not work", + "http://xml.apache.org/axis/"); + + needed+=needClass(out, "javax.xml.rpc.Service", + "jaxrpc.jar", + "JAX-RPC API", + "Axis will not work", + "http://xml.apache.org/axis/"); + + needed+=needClass(out, "org.apache.axis.transport.http.AxisServlet", + "axis.jar", + "Apache-Axis", + "Axis will not work", + "http://xml.apache.org/axis/"); + + needed+=needClass(out, "org.apache.commons.discovery.Resource", + "commons-discovery.jar", + "Jakarta-Commons Discovery", + "Axis will not work", + "http://jakarta.apache.org/commons/discovery.html"); + + needed+=needClass(out, "org.apache.commons.logging.Log", + "commons-logging.jar", + "Jakarta-Commons Logging", + "Axis will not work", + "http://jakarta.apache.org/commons/logging.html"); + + needed+=needClass(out, "org.apache.log4j.Layout", + "log4j-1.2.8.jar", + "Log4j", + "Axis may not work", + "http://jakarta.apache.org/log4j"); + + //should we search for a javax.wsdl file here, to hint that it needs + //to go into an approved directory? because we dont seem to need to do that. + needed+=needClass(out, "com.ibm.wsdl.factory.WSDLFactoryImpl", + "wsdl4j.jar", + "IBM's WSDL4Java", + "Axis will not work", + null); + + needed+=needClass(out, "javax.xml.parsers.SAXParserFactory", + "xerces.jar", + "JAXP implementation", + "Axis will not work", + "http://xml.apache.org/xerces-j/"); + + needed+=needClass(out,"javax.activation.DataHandler", + "activation.jar", + "Activation API", + "Axis will not work", + "http://java.sun.com/products/javabeans/glasgow/jaf.html"); +%> +<h3>Optional Components</h3> +<% + /* + * now the stuff we can live without + */ + wanted+=wantClass(out,"javax.mail.internet.MimeMessage", + "mail.jar", + "Mail API", + "Attachments will not work", + "http://java.sun.com/products/javamail/"); + + wanted+=wantClass(out,"org.apache.xml.security.Init", + "xmlsec.jar", + "XML Security API", + "XML Security is not supported", + "http://xml.apache.org/security/"); + + wanted += wantClass(out, "javax.net.ssl.SSLSocketFactory", + "jsse.jar or java1.4+ runtime", + "Java Secure Socket Extension", + "https is not supported", + "http://java.sun.com/products/jsse/"); + /* + * resources on the classpath path + */ + /* broken; this is a file, not a resource + wantResource(out,"/server-config.wsdd", + "There is no server configuration file;" + +"run AdminClient to create one"); + */ + /* add more libraries here */ + + out.write("<h3>"); + //is everythng we need here + if(needed==0) { + //yes, be happy + out.write("<i>The core axis libraries are present. </i>"); + } else { + //no, be very unhappy + response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + out.write("<i>" + +needed + +" core axis librar" + +(needed==1?"y is":"ies are") + +" missing</i>"); + } + //now look at wanted stuff + if(wanted>0) { + out.write("<i>" + +wanted + +" optional axis librar" + +(wanted==1?"y is":"ies are") + +" missing</i>"); + } else { + out.write("The optional components are present."); + } + out.write("</h3>"); + //hint if anything is missing + if(needed>0 || wanted>0 ) { + out.write(getInstallHints(request)); + } + + %> + <p> + <B><I>Note:</I></B> Even if everything this page probes for is present, there is no guarantee your + web service will work, because there are many configuration options that we do + not check for. These tests are <i>necessary</i> but not <i>sufficient</i> + <hr> + + <h2>Examining Application Server</h2> + <% + String servletVersion=getServletVersion(); + String xmlParser=getParserName(); + String xmlParserLocation = getParserLocation(out); + + %> + <table> + <tr><td>Servlet version</td><td><%= servletVersion %></td></tr> + <tr><td>XML Parser</td><td><%= xmlParser %></td></tr> + <tr><td>XML ParserLocation</td><td><%= xmlParserLocation %></td></tr> + </table> +<% if(xmlParser.indexOf("crimson")>=0) { %> + <p> + <b>We recommend <a href="http://xml.apache.org/xerces2-j/">Xerces 2</a> + over Crimson as the XML parser for Axis</b> + </p> +<% } %> + + <h2>Examining System Properties</h2> +<% + /** + * Dump the system properties + */ + java.util.Enumeration e=null; + try { + e= System.getProperties().propertyNames(); + } catch (SecurityException se) { + } + if(e!=null) { + out.write("<pre>"); + for (;e.hasMoreElements();) { + String key = (String) e.nextElement(); + out.write(key + "=" + System.getProperty(key)+"\n"); + } + out.write("</pre><p>"); + } else { + out.write("System properties are not accessible<p>"); + } +%> + <hr> + Platform: <%= getServletConfig().getServletContext().getServerInfo() %> +</body> +</html> + + Added: incubator/beehive/trunk/samples/EnhancedAddressBookWS/index.html Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/EnhancedAddressBookWS/index.html?view=auto&rev=124839 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/samples/EnhancedAddressBookWS/index.html Mon Jan 10 15:06:00 2005 @@ -0,0 +1,31 @@ +<html> + +<head> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> +<title>Apache-Beehive</title> +</head> + +<body bgcolor="#FFFFFF"> +<h1 align="center">Beehive Web Services</h1> +<p><em>Welcome</em> to the Enhanced AddressBook Web service!</p> +<p>What would you like to do today?</p> +<ul> + <li> + <a href="happyaxis.jsp">Validate</a> the local installation + <br> + <i>see below if this does not work.</i> + </li> + <li> + View The Enhanced AddressBook Web Service's + <a href="web/Service.jws?wsdl">WSDL</a> + </li> +</ul> + +<h3>Validating the local configuration</h3> + +If the validation page displays an exception instead of a +status page, the likely cause is that you have multiple XML parsers in +your classpath. Clean up your classpath by eliminating extraneous parsers. + +</body> +</html>
