You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/10/31 03:53:25 UTC

svn commit: r329714 - in /beehive/trunk/wsm: ./ src/core/org/apache/beehive/wsm/model/jsr181/ src/core/org/apache/beehive/wsm/processor/ src/core/org/apache/beehive/wsm/processor/apt/ src/core/org/apache/beehive/wsm/processor/generator/ src/core/org/ap...

Author: ekoneil
Date: Sun Oct 30 18:53:09 2005
New Revision: 329714

URL: http://svn.apache.org/viewcvs?rev=329714&view=rev
Log:
WSM work to:

- implement the correct handling of web methods in the presence / absence of @WebMethod annotations.
- add a TypeResolver abstraction that allows WSM artifact generators to resolve types during generation.
- added Jeremiah Johnson's tests for BEEHIVE-877 which were very helpful in implementing and debugging this 
- fixed the IOExceptions that have been thrown during testsing.  These were caused when the annotation processor generated duplicate files.
- additional cleanup

BB: self
DRT: Beehive pass


Added:
    beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/TypeResolver.java   (with props)
    beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/MirrorTypeResolver.java   (with props)
    beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/resolver/
    beehive/trunk/wsm/test/src/junit-server/org/apache/beehive/wsm/test/axis/wsdl/WebMethodOverrideTest.java   (with props)
    beehive/trunk/wsm/test/webapp/src-ws/webservice/AllPublicMethods.java   (with props)
    beehive/trunk/wsm/test/webapp/src-ws/webservice/WebMethodOverride.java   (with props)
Modified:
    beehive/trunk/wsm/build.xml
    beehive/trunk/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ObjectModelStore.java
    beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/TwoPhaseAnnotationProcessor.java
    beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/apt/WsmAnnotationProcessor.java
    beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/generator/AxisGenerator.java
    beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/generator/WsmResourceGenerator.java
    beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/BeehiveWsTypeMetadataFactory.java
    beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/MirrorFactoryImpl.java
    beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/ReflectionFactoryImpl.java
    beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/WSDLFactoryImpl.java
    beehive/trunk/wsm/test/build.xml
    beehive/trunk/wsm/test/src/junit-server/org/apache/beehive/wsm/test/axis/wsdl/Util.java
    beehive/trunk/wsm/test/src/junit-services/org/apache/beehive/wsm/axis/FakeDocWebService.java
    beehive/trunk/wsm/test/src/junit/org/apache/beehive/wsm/axis/handlers/FaultTest.java
    beehive/trunk/wsm/test/src/junit/org/apache/beehive/wsm/test/jsr181/wsdl/WSDL2AnnotatedJavaTest.java

Modified: beehive/trunk/wsm/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/build.xml?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/build.xml (original)
+++ beehive/trunk/wsm/build.xml Sun Oct 30 18:53:09 2005
@@ -200,12 +200,9 @@
         <echo message="|      WSM AXIS build ending                     |"/>
         <echo message="--------------------------------------------------"/>
     </target>
+
+    <target name="deploy" depends="build" description="Deploy WSM"/>
     
-    <!-- ==================================================================== -->
-    <!-- deploy -->
-    <!-- ==================================================================== -->
-    <target name="deploy" depends="build"/>
-                    
     <!-- ==================================================================== -->
     <!-- deploy.webservice.runtime -->
     <!-- ==================================================================== -->

Modified: beehive/trunk/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ObjectModelStore.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ObjectModelStore.java?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ObjectModelStore.java (original)
+++ beehive/trunk/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ObjectModelStore.java Sun Oct 30 18:53:09 2005
@@ -24,6 +24,8 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.OutputStream;
+import java.io.StringWriter;
+import java.io.PrintWriter;
 import java.net.URL;
 
 import com.sun.mirror.apt.AnnotationProcessorEnvironment;
@@ -90,9 +92,8 @@
             objectModel = (BeehiveWsTypeMetadata)ois.readObject();
         }
         finally {
-            if(null != ois) {
+            if(null != ois)
                 ois.close();
-            }
         }
         return objectModel;
     }
@@ -107,7 +108,7 @@
         if(objectModel == null)
             throw new ObjectModelStoreException("Can not persist empty object model");
 
-        //env.getMessager().printNotice("Persisting object model: " + objectModel.getServiceClassName());
+        env.getMessager().printNotice("======= Persisting object model: " + objectModel.getServiceClassName());
 
         OutputStream os = null;
         ObjectOutputStream oos = null;
@@ -118,7 +119,12 @@
             oos = new ObjectOutputStream(os);
             oos.writeObject(objectModel);
         }
-        catch(IOException e) {
+        catch(Throwable e) {
+            StringWriter sw = new StringWriter();
+            PrintWriter pw = new PrintWriter(sw);
+            e.printStackTrace(pw);
+            env.getMessager().printNotice(sw.toString());
+            
             throw new ObjectModelStoreException("Exception occurred writing WSM object model.  Cause: " + e, e);
         }
         finally {

Modified: beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/TwoPhaseAnnotationProcessor.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/TwoPhaseAnnotationProcessor.java?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/TwoPhaseAnnotationProcessor.java (original)
+++ beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/TwoPhaseAnnotationProcessor.java Sun Oct 30 18:53:09 2005
@@ -84,30 +84,23 @@
      * annotations claimed by this AnnotationProcessor.
      */
     public abstract void check();
-/*
-    {
-        for(AnnotationTypeDeclaration atd : _atds) {
-            Collection<Declaration> decls = _env.getDeclarationsAnnotatedWith(atd);
-            for(Declaration decl : decls) {
-                check(decl);
-            }
-        }
-    }
-*/
 
     /**
      * Emits additional artifacts for input Declarations that are annotated with
      * annotations claimed by this AnnotationProcessor.
      */
-    public void generate()
+    public abstract void generate();
+/*
         throws ProcessorException {
         for(AnnotationTypeDeclaration atd : _atds) {
             Collection<Declaration> decls = _env.getDeclarationsAnnotatedWith(atd);
             for(Declaration decl : decls) {
+                System.out.println("----- found declaration: " + decl.getSimpleName());
                 generate(decl);
             }
         }
     }
+*/
 
     /**
      * The check method is responsible for all semantic validation of the input Declaration.
@@ -128,7 +121,7 @@
      * The generate method is responsible for the generation of any additional artifacts
      * (source, class, or binary) that are derived from the input Declaration.
      */
-    public abstract void generate(Declaration decl);
+    //public abstract void generate(Declaration decl);
 
     protected AnnotationProcessorEnvironment getAnnotationProcessorEnvironment() {
         return _env;

Modified: beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/apt/WsmAnnotationProcessor.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/apt/WsmAnnotationProcessor.java?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/apt/WsmAnnotationProcessor.java (original)
+++ beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/apt/WsmAnnotationProcessor.java Sun Oct 30 18:53:09 2005
@@ -31,6 +31,7 @@
 import java.util.Set;
 import java.util.LinkedList;
 import java.util.Collection;
+import java.util.Iterator;
 
 public class WsmAnnotationProcessor
     extends TwoPhaseAnnotationProcessor {
@@ -51,8 +52,10 @@
             for(Declaration decl : decls) {
                 if(decl instanceof InterfaceDeclaration)
                     getServiceInterfaces().add((InterfaceDeclaration)decl);
-                else if(decl instanceof ClassDeclaration)
+                else if(decl instanceof ClassDeclaration && !getServiceImplementations().contains(decl)) {
+                    env.getMessager().printNotice("????? examine type declaration: " + decl.getSimpleName());
                     getServiceImplementations().add((ClassDeclaration)decl);
+                }
             }
         }
 
@@ -79,14 +82,23 @@
         }
     }
 
-    public void generate(Declaration decl) {
-        if(!(decl instanceof TypeDeclaration))
+    //public void generate(Declaration decl) {
+    public void generate() {
+        if(_serviceImplementations == null)
             return;
 
-        TypeDeclaration typeDecl = (TypeDeclaration)decl;
+        Iterator iterator = _serviceImplementations.iterator();
+        while(iterator.hasNext()) {
+            Declaration decl = (Declaration)iterator.next();
 
-        WsmResourceGenerator generator = AxisGenerator.getInstance();
-        generator.generate(getAnnotationProcessorEnvironment(), typeDecl);
+            if(!(decl instanceof TypeDeclaration))
+                continue;
+
+            TypeDeclaration typeDecl = (TypeDeclaration)decl;
+
+            WsmResourceGenerator generator = AxisGenerator.getInstance();
+            generator.generate(getAnnotationProcessorEnvironment(), typeDecl);
+        }
     }
 
     private LinkedList<ClassDeclaration> getServiceImplementations() {

Modified: beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/generator/AxisGenerator.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/generator/AxisGenerator.java?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/generator/AxisGenerator.java (original)
+++ beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/generator/AxisGenerator.java Sun Oct 30 18:53:09 2005
@@ -25,6 +25,8 @@
 import org.apache.beehive.wsm.model.jsr181.Jsr181ObjectModelStore;
 import org.apache.beehive.wsm.processor.model.factory.BeehiveWsMetadataFactory;
 import org.apache.beehive.wsm.processor.model.factory.BeehiveWsTypeMetadataFactory;
+import org.apache.beehive.wsm.processor.model.factory.TypeResolver;
+import org.apache.beehive.wsm.processor.model.factory.impl.MirrorTypeResolver;
 
 public class AxisGenerator
     extends WsmResourceGenerator {
@@ -43,20 +45,16 @@
 
         /* todo: there needs to be an environmental abstraction for resolving types from
                  a reflection client / environment and a Mirror client / environment */
-        TypeDeclaration serviceEndpointDecl = null;
-        WebService webService = typeDecl.getAnnotation(WebService.class);
-        if(webService.endpointInterface() != null && !webService.endpointInterface().equals(""))
-            serviceEndpointDecl = env.getTypeDeclaration(webService.endpointInterface());
-
-        /* when creating a BeehiveWsTypeMetadata instance, the endpoint interface (if present)
-           always wins.  If the endpoint interface is omitted, the class should be used
-           to generate the model */
-        TypeDeclaration foo = serviceEndpointDecl != null ? serviceEndpointDecl : typeDecl;
-
-        BeehiveWsTypeMetadata wsImplMetadata = factory.create(typeDecl,
-                                                              serviceEndpointDecl,
-                                                              /* todo: need to pass the file reference in here somehow... */
-                                                              null); //typeDecl.getDeclaringType().getPosition().file().getParentFile().getName());
+
+        String serviceBeanClassName = typeDecl.getQualifiedName();
+        TypeResolver typeResolver = MirrorTypeResolver.getInstance(env);
+
+        BeehiveWsTypeMetadata wsImplMetadata = factory.create(serviceBeanClassName,
+                                                              typeResolver,
+                                                              null);
+
+        //typeDecl.getDeclaringType().getPosition().file().getParentFile().getName());
+
         Jsr181ObjectModelStore.store(env, wsImplMetadata);
     }
 }

Modified: beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/generator/WsmResourceGenerator.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/generator/WsmResourceGenerator.java?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/generator/WsmResourceGenerator.java (original)
+++ beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/generator/WsmResourceGenerator.java Sun Oct 30 18:53:09 2005
@@ -27,6 +27,6 @@
 
     public abstract void generate(AnnotationProcessorEnvironment env, TypeDeclaration typeDeclaration);
 
-    /* serviceEndpoint interface generation should be peerformed in implementations of this base class
+    /* serviceEndpoint interface generation should be performed in implementations of this base class
         depending on the service's target execution environment */
 }

Modified: beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/BeehiveWsTypeMetadataFactory.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/BeehiveWsTypeMetadataFactory.java?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/BeehiveWsTypeMetadataFactory.java (original)
+++ beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/BeehiveWsTypeMetadataFactory.java Sun Oct 30 18:53:09 2005
@@ -21,7 +21,7 @@
 
 public abstract class BeehiveWsTypeMetadataFactory {
 
-    public abstract BeehiveWsTypeMetadata create(Object serviceImpl,
-                                                 Object endpointInterface,
+    public abstract BeehiveWsTypeMetadata create(String serviceBeanClassName,
+                                                 TypeResolver typeResolver,
                                                  String baseLocation);
 }

Added: beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/TypeResolver.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/TypeResolver.java?rev=329714&view=auto
==============================================================================
--- beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/TypeResolver.java (added)
+++ beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/TypeResolver.java Sun Oct 30 18:53:09 2005
@@ -0,0 +1,26 @@
+/**
+ 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.wsm.processor.model.factory;
+
+/**
+ *
+ */
+public abstract class TypeResolver {
+
+    public abstract Object resolveType(String className);
+}

Propchange: beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/TypeResolver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/MirrorFactoryImpl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/MirrorFactoryImpl.java?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/MirrorFactoryImpl.java (original)
+++ beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/MirrorFactoryImpl.java Sun Oct 30 18:53:09 2005
@@ -24,6 +24,7 @@
 import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Iterator;
 import javax.jws.WebService;
 import javax.jws.WebMethod;
 import javax.jws.Oneway;
@@ -38,8 +39,10 @@
 import com.sun.mirror.declaration.TypeDeclaration;
 import com.sun.mirror.declaration.MethodDeclaration;
 import com.sun.mirror.declaration.ParameterDeclaration;
+import com.sun.mirror.declaration.Modifier;
 
 import org.apache.beehive.wsm.processor.model.factory.BeehiveWsTypeMetadataFactory;
+import org.apache.beehive.wsm.processor.model.factory.TypeResolver;
 import org.apache.beehive.wsm.model.BeehiveWsTypeMetadata;
 import org.apache.beehive.wsm.model.BeehiveWsMethodMetadata;
 import org.apache.beehive.wsm.model.BeehiveWsParameterMetadata;
@@ -79,19 +82,22 @@
     private static final String SERVICE_SUFFIX = "Service";
     private static final String DEFAULT_WR_NAME = "return";
 
-    /* todo: this method signature would be cleaner if there was a context object that was independent
-             of Mirror or Java reflection.
-     */
-    public BeehiveWsTypeMetadata create(Object serviceImpl, Object endpointInterface, String baseLocation) {
-        assert serviceImpl instanceof TypeDeclaration;
-
+    /* todo: this method signature would be cleaner if there was a context object that was independent of Mirror or Java reflection. */
+    /* todo: need an abstraction for resolving a type here */
+    public BeehiveWsTypeMetadata create(String serviceBeanClassName,
+                                        TypeResolver typeResolver,
+                                        String baseLocation) {
         BeehiveWsTypeMetadata wsMetadata = new DefaultTypeMetadataImpl();
 
-        TypeDeclaration implDecl = (TypeDeclaration)serviceImpl;
-        TypeDeclaration endpointDecl = (TypeDeclaration)endpointInterface;
+        TypeDeclaration implDecl = (TypeDeclaration)typeResolver.resolveType(serviceBeanClassName);
+
+        TypeDeclaration endpointDecl = null;
+        WebService webService = implDecl.getAnnotation(WebService.class);
+        if(webService.endpointInterface() != null && !webService.endpointInterface().equals(""))
+            endpointDecl = (TypeDeclaration)typeResolver.resolveType(webService.endpointInterface());
 
         /* class-level annotations */
-        if(endpointInterface != null) {
+        if(endpointDecl != null) {
             processClass(wsMetadata, endpointDecl, baseLocation);
 
             String serviceName = implDecl.getAnnotation(WebService.class).serviceName();
@@ -118,9 +124,12 @@
                     allWebMethods = false;
 
             /* todo: expose *all* methods up to java.lang.Object as web service methods */
-            for(MethodDeclaration method : implDecl.getMethods())
-                if(allWebMethods || method.getAnnotation(WebMethod.class) != null)
+            for(MethodDeclaration method : implDecl.getMethods()) {
+                if(allWebMethods && acceptWebMethod(method, typeResolver))
+                    processMethod(wsMetadata, method);
+                else if(method.getAnnotation(WebMethod.class) != null)
                     processMethod(wsMetadata, method);
+            }
         }
 
         return wsMetadata;
@@ -194,6 +203,14 @@
     }
 
     private void processMethod(BeehiveWsTypeMetadata wsMetadata, MethodDeclaration methodDecl) {
+        System.out.println("Service: " + wsMetadata.getServiceName() + " add web method: " + methodDecl.getSimpleName());
+        System.out.println("is public: " + methodDecl.getModifiers().contains(Modifier.PUBLIC));
+
+        if(!methodDecl.getModifiers().contains(Modifier.PUBLIC))
+            return;
+
+        System.out.println("Service: " + wsMetadata.getServiceName() + " add web method: " + methodDecl.getSimpleName());
+
         WebMethod webMethod = methodDecl.getAnnotation(WebMethod.class);
 
         String methodName = methodDecl.getSimpleName();
@@ -390,6 +407,7 @@
      * Internal method used to validate an XMLBean.
      * @param xmlObject
      */
+    /* todo: switch to DOM for this validation */
     private static void validate(XmlObject xmlObject) {
         /* todo: compost up into a base class */
         XmlOptions validateOptions = new XmlOptions();
@@ -405,5 +423,21 @@
             }
             throw new IllegalHandlerConfigException("Error parsing @HandlerChain definition.  " + sb.toString());
         }
+    }
+
+    private boolean acceptWebMethod(MethodDeclaration webMethod, TypeResolver typeResolver) {
+        TypeDeclaration objectDecl = (TypeDeclaration)typeResolver.resolveType("java.lang.Object");
+
+        System.out.println("object decl: " + objectDecl);
+
+
+        Iterator objectMethodsIterator = objectDecl.getMethods().iterator();
+        while(objectMethodsIterator.hasNext()) {
+            MethodDeclaration objectMethod = (MethodDeclaration)objectMethodsIterator.next();
+            if(objectMethod.getSimpleName().equals(webMethod.getSimpleName()))
+                return false;
+        }
+
+        return true;
     }
 }

Added: beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/MirrorTypeResolver.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/MirrorTypeResolver.java?rev=329714&view=auto
==============================================================================
--- beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/MirrorTypeResolver.java (added)
+++ beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/MirrorTypeResolver.java Sun Oct 30 18:53:09 2005
@@ -0,0 +1,44 @@
+/**
+ 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.wsm.processor.model.factory.impl;
+
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import org.apache.beehive.wsm.processor.model.factory.TypeResolver;
+
+/**
+ *
+ */
+public class MirrorTypeResolver
+    extends TypeResolver {
+
+    public static MirrorTypeResolver getInstance(AnnotationProcessorEnvironment env) {
+        return new MirrorTypeResolver(env);
+    }
+
+    private AnnotationProcessorEnvironment _env;
+
+    private MirrorTypeResolver(AnnotationProcessorEnvironment env) {
+        _env = env;
+    }
+
+    public Object resolveType(String className) {
+        assert className != null;
+
+        return _env.getTypeDeclaration(className);
+    }
+}

Propchange: beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/MirrorTypeResolver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/ReflectionFactoryImpl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/ReflectionFactoryImpl.java?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/ReflectionFactoryImpl.java (original)
+++ beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/ReflectionFactoryImpl.java Sun Oct 30 18:53:09 2005
@@ -18,12 +18,15 @@
 package org.apache.beehive.wsm.processor.model.factory.impl;
 
 import org.apache.beehive.wsm.processor.model.factory.BeehiveWsTypeMetadataFactory;
+import org.apache.beehive.wsm.processor.model.factory.TypeResolver;
 import org.apache.beehive.wsm.model.BeehiveWsTypeMetadata;
 
 class ReflectionFactoryImpl
     extends BeehiveWsTypeMetadataFactory {
 
-    public BeehiveWsTypeMetadata create(Object serviceImpl, Object serviceEndpoint, String baseLocation) {
+    public BeehiveWsTypeMetadata create(String serviceBeanClassName,
+                                        TypeResolver typeResolver,
+                                        String baseLocation) {
         /* todo: implement */
         throw new UnsupportedOperationException("NYI");
     }

Modified: beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/WSDLFactoryImpl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/WSDLFactoryImpl.java?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/WSDLFactoryImpl.java (original)
+++ beehive/trunk/wsm/src/core/org/apache/beehive/wsm/processor/model/factory/impl/WSDLFactoryImpl.java Sun Oct 30 18:53:09 2005
@@ -18,12 +18,15 @@
 package org.apache.beehive.wsm.processor.model.factory.impl;
 
 import org.apache.beehive.wsm.processor.model.factory.BeehiveWsTypeMetadataFactory;
+import org.apache.beehive.wsm.processor.model.factory.TypeResolver;
 import org.apache.beehive.wsm.model.BeehiveWsTypeMetadata;
 
 class WSDLFactoryImpl
     extends BeehiveWsTypeMetadataFactory {
 
-    public BeehiveWsTypeMetadata create(Object serviceImpl, Object serviceEndpoint, String baseLocation) {
+    public BeehiveWsTypeMetadata create(String serviceBeanClassName,
+                                        TypeResolver typeResolver,
+                                        String baseLocation) {
         /* todo: implement */
         throw new UnsupportedOperationException("NYI");
     }

Modified: beehive/trunk/wsm/test/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/test/build.xml?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/test/build.xml (original)
+++ beehive/trunk/wsm/test/build.xml Sun Oct 30 18:53:09 2005
@@ -206,21 +206,21 @@
     <target name="junit.server" description="Execute the JUnit tests against a running server">
         <mkdir dir="${drt.logs}"/>
 
-                <junit failureproperty="wsmserverdrtfailed" printsummary="on" tempdir="${build.dir}" fork="yes">
-                    <sysproperty key="wsm.test.url" value="${webapp.waitfor.url}"/>
-                    <formatter type="plain"/>
-                    <classpath>
-                        <path refid="drt.classpath"/>
-                        <pathelement location="${junit-server.classes}"/>
-                        <pathelement location="${build.gen-tests}"/>
-                        <pathelement location="${webapp.dir}/WEB-INF/classes"/>
-                    </classpath>
-                    <batchtest filtertrace="off" todir="${drt.logs}">
-                        <fileset dir="${junit-server.src}">
-                            <include name="**/*Test.java"/>
-                        </fileset>
-                    </batchtest>
-                </junit>
+        <junit failureproperty="wsmserverdrtfailed" printsummary="on" tempdir="${build.dir}" fork="yes">
+            <sysproperty key="wsm.test.url" value="${webapp.waitfor.url}"/>
+            <formatter type="plain"/>
+            <classpath>
+                <path refid="drt.classpath"/>
+                <pathelement location="${junit-server.classes}"/>
+                <pathelement location="${build.gen-tests}"/>
+                <pathelement location="${webapp.dir}/WEB-INF/classes"/>
+            </classpath>
+            <batchtest filtertrace="off" todir="${drt.logs}">
+                <fileset dir="${junit-server.src}">
+                    <include name="**/*Test.java"/>
+                </fileset>
+            </batchtest>
+        </junit>
     </target>
 
     <target name="build.webapp.client" description="Build the client-side JUnit tests">

Modified: beehive/trunk/wsm/test/src/junit-server/org/apache/beehive/wsm/test/axis/wsdl/Util.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/test/src/junit-server/org/apache/beehive/wsm/test/axis/wsdl/Util.java?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/test/src/junit-server/org/apache/beehive/wsm/test/axis/wsdl/Util.java (original)
+++ beehive/trunk/wsm/test/src/junit-server/org/apache/beehive/wsm/test/axis/wsdl/Util.java Sun Oct 30 18:53:09 2005
@@ -21,7 +21,7 @@
 
     private static final String KEY_WSM_TEST_URL = "wsm.test.url";
 
-    static final String getBaseUrl() {
+    static String getBaseUrl() {
         String url = System.getProperty(KEY_WSM_TEST_URL);
 
         if(url == null)
@@ -29,7 +29,7 @@
         else return url;
     }
 
-    static final String buildUrl(String uri) {
+    static String buildUrl(String uri) {
         return getBaseUrl() + uri;
     }
 }

Added: beehive/trunk/wsm/test/src/junit-server/org/apache/beehive/wsm/test/axis/wsdl/WebMethodOverrideTest.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/test/src/junit-server/org/apache/beehive/wsm/test/axis/wsdl/WebMethodOverrideTest.java?rev=329714&view=auto
==============================================================================
--- beehive/trunk/wsm/test/src/junit-server/org/apache/beehive/wsm/test/axis/wsdl/WebMethodOverrideTest.java (added)
+++ beehive/trunk/wsm/test/src/junit-server/org/apache/beehive/wsm/test/axis/wsdl/WebMethodOverrideTest.java Sun Oct 30 18:53:09 2005
@@ -0,0 +1,219 @@
+/*
+ * Copyright 2005 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 org.apache.beehive.wsm.test.axis.wsdl;
+
+import java.util.List;
+import java.util.Map;
+import javax.wsdl.Definition;
+import javax.wsdl.Operation;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+
+import junit.framework.TestCase;
+
+/**
+ * Unit tests around the Web service implicit versus explicit Web methods.
+ * <p/>
+ * A couple Web services are used for this test case to touch areas of
+ * concern.  One Web service (AllPublicMethods) doesn't use the WebMethod
+ * annotation, so tests against that service are to verify that the public
+ * methods (except for those inherited from Object) are exposed.  Another
+ * Web service (WebMethodOverride) uses the WebMethod annotation on a couple
+ * methods but not on others, so tests against that service are to verify
+ * that only the annotated methods are exposed.
+ * <p/>
+ * This test currently requires a running instance of the Web container.  The
+ * URL of the server is determined by the Util class.
+ */
+public class WebMethodOverrideTest
+    extends TestCase {
+
+    /**
+     * Instance of the WSDL Reader used in the test methods; this is (re)set
+     * in the set up method.
+     */
+    private WSDLReader reader;
+
+    /**
+     * Prepare for testing by creating a new reader instance.
+     */
+    public void setUp() {
+        try {
+            reader = WSDLFactory.newInstance().newWSDLReader();
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+            fail("failed to prepare WSDL reader for tests: " + e);
+        }
+    }
+
+    /**
+     * Verify that the doSomethingPublic method is <em>not</em> exposed as
+     * a Web method since it does not use the WebMethod annotation, but other
+     * methods in the file do use the annotation.
+     */
+    public void testExplicitDoSomethingPublic()
+        throws Exception {
+        Definition wsdl = reader.readWSDL(null,
+                                          Util.buildUrl("/webservice/WebMethodOverride.jws?wsdl"));
+        assertNoOperationName(wsdl, "doSomethingPublic");
+    }
+
+    /**
+     * Verify that the doSomethingPublicWithAnnotation method is exposed as a
+     * Web method since it uses the WebMethod annotation.
+     */
+    public void testExplicitDoSomethingPublicWithAnnotation()
+        throws Exception {
+        Definition wsdl = reader.readWSDL(null,
+                                          Util.buildUrl("/webservice/WebMethodOverride.jws?wsdl"));
+        assertOperationName(wsdl, "doSomethingPublicWithAnnotation");
+    }
+
+    /**
+     * Verify that the toString with the WebMethod annotation is correctly
+     * exposed as a Web method.
+     */
+    public void testExplicitToString()
+        throws Exception {
+        Definition wsdl = reader.readWSDL(null,
+                                          Util.buildUrl("/webservice/WebMethodOverride.jws?wsdl"));
+        assertOperationName(wsdl, "toString");
+    }
+
+    /**
+     * Verify that the doSomethingDefault method is <em>not</em> exposed as
+     * a Web method since it is not a public method.
+     */
+    public void testImplicitDoSomethingDefault()
+        throws Exception {
+        Definition wsdl = reader.readWSDL(null,
+                                          Util.buildUrl("/webservice/AllPublicMethods.jws?wsdl"));
+        assertNoOperationName(wsdl, "doSomethingDefault");
+    }
+
+    /**
+     * Verify that the doSomethingPrivate method is <em>not</em> exposed as
+     * a Web method since it is not a public method.
+     */
+    public void testImplicitDoSomethingPrivate()
+        throws Exception {
+        Definition wsdl = reader.readWSDL(null,
+                                          Util.buildUrl("/webservice/AllPublicMethods.jws?wsdl"));
+        assertNoOperationName(wsdl, "doSomethingPrivate");
+    }
+
+    /**
+     * Verify that the doSomethingProtected method is <em>not</em> exposed as
+     * a Web method since it is not a public method.
+     */
+    public void testImplicitDoSomethingProtected()
+        throws Exception {
+        Definition wsdl = reader.readWSDL(null,
+                                          Util.buildUrl("/webservice/AllPublicMethods.jws?wsdl"));
+        assertNoOperationName(wsdl, "doSomethingProtected");
+    }
+
+    /**
+     * Verify that the doSomethingPublic method is exposed as a Web method
+     * since no methods in the service use the WebMethod annotation.
+     */
+    public void testImplicitDoSomethingPublic()
+        throws Exception {
+        Definition wsdl = reader.readWSDL(null,
+                                          Util.buildUrl("/webservice/AllPublicMethods.jws?wsdl"));
+        assertOperationName(wsdl, "doSomethingPublic");
+    }
+
+    /**
+     * Verify that the hashCode method is <em>not</em> exposed as a Web
+     * method since it is inherited from java.lang.Object; this test exists
+     * simply to be exhaustive - this may or may not differ with the implicit
+     * toString results.
+     */
+    public void testImplicitHashCode()
+        throws Exception {
+        Definition wsdl = reader.readWSDL(null,
+                                          Util.buildUrl("/webservice/AllPublicMethods.jws?wsdl"));
+        assertNoOperationName(wsdl, "hashCode");
+    }
+
+    /**
+     * Verify that the toString method is <em>not</em> exposed as a Web
+     * method since it is inherited from java.lang.Object.
+     * <p/>
+     * This test is in an area that may be up to interpretation: the spec says
+     * that methods inherited from java.lang.Object shouldn't be exposed.  The
+     * Web service overrides the implementation of toString, but according to
+     * my interpretation of the spec it shouldn't appear as a Web method.
+     * </p>
+     */
+    public void testImplicitToString()
+        throws Exception {
+        Definition wsdl = reader.readWSDL(null,
+                                          Util.buildUrl("/webservice/AllPublicMethods.jws?wsdl"));
+        assertNoOperationName(wsdl, "toString");
+    }
+
+    /**
+     * Assuming one service and port, verify that the given operation is
+     * not defined in the WSDL.
+     */
+    private static void assertNoOperationName(Definition wsdl,
+                                              String operationName) {
+        List<Operation> operations = getOperations(wsdl);
+        assertNotNull("operations", operations);
+        for (Operation operation : operations) {
+            if (operationName.equals(operation.getName())) {
+                fail("operation " + operationName + " not expected");
+            }
+        }
+    }
+
+    /**
+     * Assuming one service and port, verify that the given operation name is
+     * found in the WSDL.
+     */
+    private static void assertOperationName(Definition wsdl,
+                                            String operationName) {
+        List<Operation> operations = getOperations(wsdl);
+        assertNotNull("operations", operations);
+        for (Operation operation : operations) {
+            if (operationName.equals(operation.getName())) {
+                return;
+            }
+        }
+        fail("didn't find expected operation " + operationName);
+    }
+
+    /**
+     * This internal method assumes that the given WSDL has one service and
+     * one port type.
+     */
+    private static List<Operation> getOperations(Definition wsdl) {
+        Map services = wsdl.getServices();
+        Service service = (Service) services.values().toArray()[0];
+
+        Map ports = service.getPorts();
+        PortType portType =
+            ((Port) ports.values().toArray()[0]).getBinding().getPortType();
+
+        return portType.getOperations();
+    }
+}

Propchange: beehive/trunk/wsm/test/src/junit-server/org/apache/beehive/wsm/test/axis/wsdl/WebMethodOverrideTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/wsm/test/src/junit-services/org/apache/beehive/wsm/axis/FakeDocWebService.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/test/src/junit-services/org/apache/beehive/wsm/axis/FakeDocWebService.java?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/test/src/junit-services/org/apache/beehive/wsm/axis/FakeDocWebService.java (original)
+++ beehive/trunk/wsm/test/src/junit-services/org/apache/beehive/wsm/axis/FakeDocWebService.java Sun Oct 30 18:53:09 2005
@@ -60,6 +60,6 @@
     @WebMethod
     public String doThrowRuntimeException()
         throws SimpleUserDefinedException, ComplexUserDefinedException {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException();
     }
 }

Modified: beehive/trunk/wsm/test/src/junit/org/apache/beehive/wsm/axis/handlers/FaultTest.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/test/src/junit/org/apache/beehive/wsm/axis/handlers/FaultTest.java?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/test/src/junit/org/apache/beehive/wsm/axis/handlers/FaultTest.java (original)
+++ beehive/trunk/wsm/test/src/junit/org/apache/beehive/wsm/axis/handlers/FaultTest.java Sun Oct 30 18:53:09 2005
@@ -36,14 +36,17 @@
 public class FaultTest extends TestCase {
     private SOAPService fakeSOAPService;
 
-    public void setUp() throws Exception {
+    public void setUp()
+        throws Exception {
         final String classname = "org.apache.beehive.wsm.axis.FakeDocWebService";
         AnnotatedWebServiceDeploymentHandler hdlr = new AnnotatedWebServiceDeploymentHandler();
         Class clazz = Class.forName(classname);
         fakeSOAPService = hdlr.getSOAPService(clazz);
     }
 
-    public void testSimpleUserDefinedExceptions() throws Exception {
+    public void testSimpleUserDefinedExceptions()
+        throws Exception {
+
         MessageContext mc = new MessageContext(new AxisServer());
         SOAPEnvelope env = new SOAPEnvelope();
         env.addBodyElement(new RPCElement("doThrowSimpleUserDefinedFault"));
@@ -52,28 +55,32 @@
         try {
             fakeSOAPService.invoke(mc);
             fail("The Expected exception didn't happen!");
-        } catch (AxisFault e) {
-        } // expected a fault
+        }
+        catch (AxisFault e) {} // expected a fault
+
         Message msg = mc.getResponseMessage();
         msg.saveChanges();
         assertNotNull(msg);
-        if (null != msg) {
-            SOAPFault n = (SOAPFault) msg.getSOAPBody().getFirstChild();
-            MessageElement detail = n.getChildElement(new QName("detail"));
-
-            for (Iterator it = detail.getChildElements(); it.hasNext();) {
-                Element de = (Element) it.next();
-                String localName = de.getLocalName();
-                String namespace = de.getNamespaceURI();
-                if (localName.equals("SimpleUserDefinedExceptionFault")
-                    && namespace.equals("http://fake.target.namespace/")) {
-                    NodeList nl = de.getChildNodes();
-                    assertTrue(nl.getLength() == 0);
-                    return;
-                }
+
+        System.out.println(msg.toString());
+
+        SOAPFault n = (SOAPFault) msg.getSOAPBody().getFirstChild();
+        MessageElement detail = n.getChildElement(new QName("detail"));
+
+        System.out.println("message detail: " + detail.getAsString());
+
+        for (Iterator it = detail.getChildElements(); it.hasNext();) {
+            Element de = (Element)it.next();
+            String localName = de.getLocalName();
+            String namespace = de.getNamespaceURI();
+            if (localName.equals("SimpleUserDefinedExceptionFault") && namespace.equals("http://fake.target.namespace/")) {
+                NodeList nl = de.getChildNodes();
+                System.out.println("length: " + nl.getLength());
+                assertTrue(nl.getLength() == 0);
+                return;
             }
-            fail("Didn't find the exception name in the Fault detail");
         }
+        fail("Didn't find the exception name in the Fault detail");
     }
 
     public void testComplexUserDefinedExceptions() throws Exception {

Modified: beehive/trunk/wsm/test/src/junit/org/apache/beehive/wsm/test/jsr181/wsdl/WSDL2AnnotatedJavaTest.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/test/src/junit/org/apache/beehive/wsm/test/jsr181/wsdl/WSDL2AnnotatedJavaTest.java?rev=329714&r1=329713&r2=329714&view=diff
==============================================================================
--- beehive/trunk/wsm/test/src/junit/org/apache/beehive/wsm/test/jsr181/wsdl/WSDL2AnnotatedJavaTest.java (original)
+++ beehive/trunk/wsm/test/src/junit/org/apache/beehive/wsm/test/jsr181/wsdl/WSDL2AnnotatedJavaTest.java Sun Oct 30 18:53:09 2005
@@ -31,8 +31,10 @@
  * The java class is generated during the build process for this drt, from
  * the wsdl2ajava ant task.
  */
-public class WSDL2AnnotatedJavaTest extends TestCase {
+public class WSDL2AnnotatedJavaTest
+    extends TestCase {
 
+    private static final Class[] EMPTY_PARAMS = new Class[0];
     private static final String generatedFromWSDL = "web.Service";
 
     public void testWebServiceAnnotationGeneration() throws Exception {
@@ -92,7 +94,7 @@
         Class fromWsdl = Class.forName(generatedFromWSDL);
         assertNotNull(fromWsdl);
 
-        Method m = fromWsdl.getMethod("oneWayWithNoParameter", null);
+        Method m = fromWsdl.getMethod("oneWayWithNoParameter", EMPTY_PARAMS);
         assertNotNull(m);
 
         WebMethod a = m.getAnnotation(javax.jws.WebMethod.class);
@@ -209,7 +211,7 @@
         Class fromWsdl = Class.forName(generatedFromWSDL);
         assertNotNull(fromWsdl);
 
-        Method m = fromWsdl.getMethod("simpleNoParamMethod", null);
+        Method m = fromWsdl.getMethod("simpleNoParamMethod", EMPTY_PARAMS);
         assertNotNull(m);
 
         WebMethod a = m.getAnnotation(javax.jws.WebMethod.class);

Added: beehive/trunk/wsm/test/webapp/src-ws/webservice/AllPublicMethods.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/test/webapp/src-ws/webservice/AllPublicMethods.java?rev=329714&view=auto
==============================================================================
--- beehive/trunk/wsm/test/webapp/src-ws/webservice/AllPublicMethods.java (added)
+++ beehive/trunk/wsm/test/webapp/src-ws/webservice/AllPublicMethods.java Sun Oct 30 18:53:09 2005
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2005 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 webservice;
+
+import javax.jws.WebService;
+
+/**
+ * This Web service is used in tests to verify that all public methods
+ * other than those inherited from java.lang.Object will be exposed as
+ * Web service operations.
+ * <p/>
+ * The 1.0 version of the JSR-181 specification specification says this:
+ * If the implementation bean does not implement a service endpoint interface,
+ * all public methods other than those inherited from java.lang.Object will
+ * be exposed as Web service operations.
+ * </p>
+ */
+@WebService
+public class AllPublicMethods {
+
+    /**
+     * This method is public; since the WebMethod annotation is not used in
+     * this service, then this method becomes a WebMethod and should appear
+     * in the WSDL.
+     */
+    public int doSomethingPublic(String param) {
+        return 0;
+    }
+
+    /**
+     * This method is protected, so it should not appear in the WSDL.
+     */
+    protected int doSomethingProtected(String param) {
+        return 0;
+    }
+
+    /**
+     * This method is default protection, so it should not appear in the WSDL.
+     */
+    int doSomethingDefault(String param) {
+        return 0;
+    }
+
+    /**
+     * This method is private, so it should not appear in the WSDL.
+     */
+    private int doSomethingPrivate(String param) {
+        return 0;
+    }
+
+    /**
+     * Since this is inherited from java.lang.Object, it should not appear
+     * in the WSDL.
+     */
+    public String toString() {
+        return "AllPublicMethods.toString()";
+    }
+}

Propchange: beehive/trunk/wsm/test/webapp/src-ws/webservice/AllPublicMethods.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/wsm/test/webapp/src-ws/webservice/WebMethodOverride.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/test/webapp/src-ws/webservice/WebMethodOverride.java?rev=329714&view=auto
==============================================================================
--- beehive/trunk/wsm/test/webapp/src-ws/webservice/WebMethodOverride.java (added)
+++ beehive/trunk/wsm/test/webapp/src-ws/webservice/WebMethodOverride.java Sun Oct 30 18:53:09 2005
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2005 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 webservice;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+/**
+ * This Web service is used in tests to verify that only those methods with
+ * the WebMethod annotation are exposed in the WSDL; this service should be
+ * considered in contrast to the AllPublicMethods service in this same
+ * package.
+ * <p/>
+ * The 1.0 version of the JSR-181 specification specification says this:
+ * If a WebMethod annotation is present, only the methods to which it is
+ * applied are exposed.
+ * </p>
+ */
+@WebService
+public class WebMethodOverride {
+
+    /**
+     * This method is public, but it doesn't have the WebMethod annotation;
+     * it should not appear in the WSDL.
+     */
+    public int doSomethingPublic(String param) {
+        return 0;
+    }
+
+    /**
+     * This method is public and has the WebMethod annotation, so it should
+     * appear in the WSDL.
+     */
+    @WebMethod
+    public int doSomethingPublicWithAnnotation(String param) {
+        return 0;
+    }
+
+    /**
+     * This method is inherited from java.lang.Object, but since it carries
+     * the WebMethod annotation it should appear in the WSDL.
+     */
+    @WebMethod
+    public String toString() {
+        return "WebMethodOverride.toString()";
+    }
+}

Propchange: beehive/trunk/wsm/test/webapp/src-ws/webservice/WebMethodOverride.java
------------------------------------------------------------------------------
    svn:eol-style = native