You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by mm...@apache.org on 2004/10/11 19:15:36 UTC

svn commit: rev 54603 - in incubator/beehive/trunk/wsm: drt/tests drt/tests/org/apache/beehive/wsm/jsr181/model drt/tests/org/apache/beehive/wsm/jsr181/processor/reflection src/runtime/org/apache/beehive/wsm/jsr181/model src/runtime/org/apache/beehive/wsm/jsr181/processor/apt src/runtime/org/apache/beehive/wsm/jsr181/processor/reflection

Author: mmerz
Date: Mon Oct 11 10:15:35 2004
New Revision: 54603

Added:
   incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/processor/reflection/WsmAnnotationProcessorEndpointInterfaceTest.java
   incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/processor/apt/WebServiceMetadataViewer.java
Modified:
   incubator/beehive/trunk/wsm/drt/tests/Cheetorama.java
   incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/model/BarTestCase.java
   incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/model/Jsr181ModelTest.java
   incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/WebServiceMETHODMetadata.java
   incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/WebServicePARAMETERMetadata.java
   incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/processor/apt/WsmAnnotationProcessor.java
   incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/processor/reflection/WsmReflectionAnnotationProcessor.java
Log:
Contributor: Wolfgang

Checkins for "@WebService.endpointInterface" support.

Also, fixed unit tests and added an error checks to annotation processing in WebServiceMETHODMetadata WebServicePARAMETERMetadata (Michael).

--

Hi Michael,

I've finished implementing the endpoint interface support for WsmReflectionAnnotationProcessor.
As you said, only java class name is allowed for WsmReflectionAnnotationProcessor to use in @WebService.endpointInterface annotation.

> Also, keep in mind that all methods defined in a service endpoint 
> interface are automatically considered @WebMethods -- whether they are 
> annotated or not.
I've added the implementation of this for both WsmReflectionAnnotationProcessor and WsmAnnotationProcessor.
I was supposed to implement this before, but totally forgot.  :( sorry...  anyways, it's done now.

I got a new question. 

If the service implementation bean or the service endpoint interface has a method( annotated with @WebMethod ) having a parameter which is NOT annotated with @WebParam like below,
-------------------------
@WebMethod
public int addPersion(@WebParam String name, int age);
-------------------------
(NOTICE: the parameter age is not annotated with @WebParam.) Will the parameter age be exposed ? In the other words,  should the parameter age be included in an object model ?
Or the existence of a non-annotated parameter of a method annotated with @WebMethod is illegal to JSR-181 ? 

JSR-181 doesn't state about this as far as I read it...

I'm sorry to ask you several times and took a long time to implement such a little stuff...

Let me explain the attachment.

-WebServiceMETHODMetadata.java
	It used to throw an exception if a @WebMethod annotation is not used on 
	a method declaration and the method is passed to the constructor of this 
	class.
	Modified this class not to throw an exception even though the annotation
	is not found since the methods of the service endpoint interface are not 
	promised to be annotated with @WebMethod, but must be included in an object 
	model.
	
	NOTE: This modification causes failure of 
	      org.apache.beehive.wsm.jsr181.model.Jsr181ModelTest test case.

-Cheetorama.java
	Added a "public int dropMoney(int amount);" method.
	This class is not annotated with any annotations.

-BarTestCase.java
	Added a test case that tests the dropMoney method of the Cheetorama class 
	which is a service endpoint interface is included in an object model.

-WsmAnnotationProcessor.java
	Modified this class to satisfy that all methods defined in a service endpoint
	interface are automatically considered @WebMethods.

-WsmReflectionAnnotationProcessor.java
	Modified this class to support the endpoint interface.

Add two classes below.
-WsmAnnotationProcessorEndpointInterfaceTest.java 
	This class is a test case for checking the endpoint interface created by
	reflection.
-WebServiceMetadataViewer.java
	This class is just a utility that displays the object model tree for debug.


NOTE:
org.apache.beehive.wsm.jsr181.model.Jsr181ModelTest will fail.
This is because of the modification to WebServiceMETHODMetadata.java.

Thanks in advance.

Wolfgang



Modified: incubator/beehive/trunk/wsm/drt/tests/Cheetorama.java
==============================================================================
--- incubator/beehive/trunk/wsm/drt/tests/Cheetorama.java	(original)
+++ incubator/beehive/trunk/wsm/drt/tests/Cheetorama.java	Mon Oct 11 10:15:35 2004
@@ -41,4 +41,6 @@
     @WebMethod
     @Oneway
     public void goHome(@WebParam(name="whenCheetorama") long time);
+    
+    public int dropMoney(int amount);
 }

Modified: incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/model/BarTestCase.java
==============================================================================
--- incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/model/BarTestCase.java	(original)
+++ incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/model/BarTestCase.java	Mon Oct 11 10:15:35 2004
@@ -82,6 +82,19 @@
         );
     }
 
+    public void testWebMethodDropMoney() throws Exception
+    {
+        WebServiceMETHODMetadata method = getMethod("dropMoney");
+        assertNotNull("Cannot find WebMethod dropMoney();", method);
+        assertEquals("Invalid wmAction;", "", method.getWmAction());
+        assertFalse("Unexpected @Oneway;", method.isOneWay());
+        assertEquals("Unexpected @WebResult;", "result", method.getWrName());
+        assertEquals("Unexpected return type;",
+            int.class,
+            method.getJavaReturnType()
+        );
+    }
+
     public void testWebParamGoLocoFirst() throws Exception
     {
         final int paramNo = 0;
@@ -114,6 +127,18 @@
         assertEquals("Invalid wpName;", "whenCheetorama", param.getWpName());
         assertEquals("Invalid return type: " + param.getJavaType(),
             long.class,
+            param.getJavaType()
+        );
+    }
+
+    public void testWebParamDropMoneyFirst() throws Exception
+    {
+        final int paramNo = 0;
+        WebServicePARAMETERMetadata param = getParam("dropMoney", paramNo);
+        assertNotNull("Cannot find first param for method dropMoney();", param);
+        assertEquals("Invalid wpName;", "amount", param.getWpName());
+        assertEquals("Invalid return type: " + param.getJavaType(),
+            int.class,
             param.getJavaType()
         );
     }

Modified: incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/model/Jsr181ModelTest.java
==============================================================================
--- incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/model/Jsr181ModelTest.java	(original)
+++ incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/model/Jsr181ModelTest.java	Mon Oct 11 10:15:35 2004
@@ -133,6 +133,10 @@
     //
     public void testMETHODConstructor() throws Exception
     {
+        Collection<Annotation> methodAnnotations = new ArrayList<Annotation>();
+
+        /*
+         * @WebMethod not required anymore -> endpointInterface/implementation bean
         try {
             WebServiceMETHODMetadata method =
                 new WebServiceMETHODMetadata(null, "methodname", void.class, false, null, null);
@@ -143,7 +147,6 @@
             // good case
         }
         
-        Collection<Annotation> methodAnnotations = new ArrayList<Annotation>();
         try {
             WebServiceMETHODMetadata method =
                 new WebServiceMETHODMetadata(null, "methodname", void.class, false, methodAnnotations, null);
@@ -153,6 +156,7 @@
         {
             // good case
         }
+         */
 
         WebMethod mAnnotation = new FakeWebMethodAnnotation("", "");
         methodAnnotations.add(mAnnotation);

Added: incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/processor/reflection/WsmAnnotationProcessorEndpointInterfaceTest.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/processor/reflection/WsmAnnotationProcessorEndpointInterfaceTest.java	Mon Oct 11 10:15:35 2004
@@ -0,0 +1,80 @@
+package org.apache.beehive.wsm.jsr181.processor.reflection;
+
+/*
+ * 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 org.apache.beehive.wsm.jsr181.model.BarTestCase;
+import org.apache.beehive.wsm.jsr181.model.WebServiceTYPEMetadata;
+import org.apache.beehive.wsm.jsr181.model.WebServicePARAMETERMetadata;
+import org.apache.beehive.wsm.jsr181.processor.apt.WebServiceMetadataViewer;
+
+/**
+ * Test case verifies that a class file can be read and its annotations can be
+ * interpreted by the annotation processor.
+ * Overrides some tests that are defined in the base class.
+ */
+public class WsmAnnotationProcessorEndpointInterfaceTest extends BarTestCase {
+
+    @Override
+    public void setUp() throws Exception
+    {
+        Class clazz = Class.forName(CLASSNAME);
+        objectModel = WsmReflectionAnnotationProcessor.getObjectModel(clazz);
+        WebServiceMetadataViewer.print( (WebServiceTYPEMetadata) objectModel );
+    }
+
+    @Override
+    public void tearDown() throws Exception
+    {
+        // empty
+    }
+
+    /**
+     * We can't derive default values for WebParam from binaries. Thus, we use
+     * our own default name "in<number>".
+     */
+    @Override
+    public void testWebParamGoLocoFirst() throws Exception
+    {
+        final int paramNo = 0;
+        WebServicePARAMETERMetadata param = getParam("GoLocoCheetorama", paramNo);
+        assertNotNull("Cannot find first param for WebMethod GoLocoCheetorama()", param);
+        assertEquals("Invalid wpName", "in" + paramNo, param.getWpName());
+        assertEquals("Invalid return type: " + param.getJavaType(),
+            int.class,
+            param.getJavaType()
+        );
+    }
+
+    /**
+     * We can't derive default values for WebParam from binaries. Thus, we use
+     * our own default name "in<number>".
+     */
+    @Override
+    public void testWebParamDropMoneyFirst() throws Exception
+    {
+        final int paramNo = 0;
+        WebServicePARAMETERMetadata param = getParam("dropMoney", paramNo);
+        assertNotNull("Cannot find first param for WebMethod dropMoeny()", param);
+        assertEquals("Invalid wpName", "in" + paramNo, param.getWpName());
+        assertEquals("Invalid return type: " + param.getJavaType(),
+            int.class,
+            param.getJavaType()
+        );
+    }
+}

Modified: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/WebServiceMETHODMetadata.java
==============================================================================
--- incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/WebServiceMETHODMetadata.java	(original)
+++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/WebServiceMETHODMetadata.java	Mon Oct 11 10:15:35 2004
@@ -71,11 +71,14 @@
         this.javaMethodName = javaMethodName;
         this.javaReturnType = javaReturnType;
 
+        // NOTE: commented the statements below for the service endpoint interface.
+        //       All methods defined in a service endpoint interface are automatically
+        //       considered @WebMethods -- whether they are annotated or not.
         // check required parameters
-        if (null == methodAnnotation) {
-            throw new IllegalArgumentException("@WebMethod is required");
-        }
-        
+        //if (null == methodAnnotation) {
+        //    throw new IllegalArgumentException("@WebMethod is required");
+        //}
+
         setWrName("result");
         
         // enforce JSR-181 rules
@@ -123,24 +126,27 @@
         initFromAnnotation(methodAnnotation);
 
         // set optional annotations
-        for (Annotation a : annotations)
+        if (null != annotations)
         {
-            // add defaults
-            if (a.annotationType() == javax.jws.Oneway.class)
-            {
-                initFromAnnotation((javax.jws.Oneway) a);
-            }
-            else if (a.annotationType() == javax.jws.security.SecurityRoles.class)
-            {
-                initFromAnnotation((javax.jws.security.SecurityRoles) a);
-            }
-            else if (a.annotationType() == javax.jws.WebResult.class)
-            {
-                initFromAnnotation((javax.jws.WebResult) a);
-            }
-            else
+            for (Annotation a : annotations)
             {
-                // todo: warning -- unknown annotation
+                // add defaults
+                if (a.annotationType() == javax.jws.Oneway.class)
+                {
+                    initFromAnnotation((javax.jws.Oneway) a);
+                }
+                else if (a.annotationType() == javax.jws.security.SecurityRoles.class)
+                {
+                    initFromAnnotation((javax.jws.security.SecurityRoles) a);
+                }
+                else if (a.annotationType() == javax.jws.WebResult.class)
+                {
+                    initFromAnnotation((javax.jws.WebResult) a);
+                }
+                else
+                {
+                    // todo: warning -- unknown annotation
+                }
             }
         }
 

Modified: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/WebServicePARAMETERMetadata.java
==============================================================================
--- incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/WebServicePARAMETERMetadata.java	(original)
+++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/WebServicePARAMETERMetadata.java	Mon Oct 11 10:15:35 2004
@@ -56,16 +56,19 @@
         setWpName(defaultName);       // in case there are no annotations
         
         // set optional annotations
-        for (Annotation a : annotations)
+        if (null != annotations)
         {
-            // add defaults
-            if (a.annotationType() == javax.jws.WebParam.class)
+            for (Annotation a : annotations)
             {
-                initFromAnnotation((javax.jws.WebParam) a);
-            }
-            else
-            {
-                // todo: warning -- unknown annotation
+                // add defaults
+                if (a.annotationType() == javax.jws.WebParam.class)
+                {
+                    initFromAnnotation((javax.jws.WebParam) a);
+                }
+                else
+                {
+                    // todo: warning -- unknown annotation
+                }
             }
         }
     }

Added: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/processor/apt/WebServiceMetadataViewer.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/processor/apt/WebServiceMetadataViewer.java	Mon Oct 11 10:15:35 2004
@@ -0,0 +1,222 @@
+package org.apache.beehive.wsm.jsr181.processor.apt;
+
+/*
+ * 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 com.sun.tools.apt.Main;
+
+import java.lang.annotation.Annotation;
+
+import java.io.File;
+import java.io.PrintWriter;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.apt.Filer;
+import com.sun.mirror.apt.Filer.Location;
+
+import com.sun.mirror.declaration.AnnotationMirror;
+import com.sun.mirror.declaration.AnnotationTypeDeclaration;
+import com.sun.mirror.declaration.ClassDeclaration;
+import com.sun.mirror.declaration.Declaration;
+import com.sun.mirror.declaration.MethodDeclaration;
+import com.sun.mirror.declaration.ParameterDeclaration;
+
+
+import com.sun.mirror.declaration.FieldDeclaration;
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.declaration.PackageDeclaration;
+
+import com.sun.mirror.util.SourcePosition;
+
+import com.sun.mirror.type.AnnotationType;
+import com.sun.mirror.type.*;
+
+import org.apache.beehive.wsm.jsr181.model.*;
+import org.apache.beehive.wsm.jsr181.model.AnnotationModel;
+import org.apache.beehive.wsm.jsr181.model.WebServiceMETHODMetadata;
+import org.apache.beehive.wsm.jsr181.model.WebServicePARAMETERMetadata;
+import org.apache.beehive.wsm.jsr181.model.WebServiceTYPEMetadata;
+
+import javax.jws.*;
+import javax.jws.WebParam;
+import javax.jws.soap.*;
+import javax.jws.soap.SOAPBinding;
+
+public class WebServiceMetadataViewer {
+
+    // adhock. assume Metadata is not nested more than 5 times.  :p
+    private static String[] TABS = new String[]{
+                                                "",
+                                                "   ",
+                                                "      ",
+                                                "         ",
+                                                "            ",
+                                                "               "
+                                               };
+
+    public static void print ( WebServiceTYPEMetadata webServiceTYPEMetadata ){
+        print( 0, webServiceTYPEMetadata );
+    }
+
+    public static void print ( int tab, WebServiceTYPEMetadata webServiceTYPEMetadata ){
+        print( tab, "<TYPE > > >WebServiceTYPEMetadata");
+        print( tab, "wsName"              , webServiceTYPEMetadata.getWsName() );
+        print( tab, "wsServiceName"       , webServiceTYPEMetadata.getWsServiceName() );
+        print( tab, "wsWsdlLocation"      , webServiceTYPEMetadata.getWsWsdlLocation() );
+        print( tab, "wsTargetNamespace"   , webServiceTYPEMetadata.getWsTargetNamespace() );
+        print( tab, "wsEndpointInterface" , webServiceTYPEMetadata.getWsEndpointInterface() );
+        print( tab, "hcFileName"          , webServiceTYPEMetadata.getHcFileName() );
+        print( tab, "hcName"              , webServiceTYPEMetadata.getHcName() );
+        //print( tab, "siRunAs"             , webServiceTYPEMetadata.getSiRunAs() );
+        print( tab, "javaFQClassName"     , webServiceTYPEMetadata.getJavaFQClassName() );
+
+        print("");
+
+        tab++;
+
+        print( tab, webServiceTYPEMetadata.getMethods() );
+        print( tab, webServiceTYPEMetadata.getSoapBinding() );
+        print( tab, webServiceTYPEMetadata.getSecurityRoles() );
+
+    }
+
+    public static void print ( Collection collection ){
+        print(0, collection);
+    }
+
+    public static void print ( int tab, Collection collection ){
+        if(collection == null)
+            return;
+
+        for( Object element : collection ){
+            if ( element instanceof WebServiceTYPEMetadata ) {
+                print( tab, (WebServiceTYPEMetadata) element );
+            }else if ( element instanceof WebServiceMETHODMetadata ) {
+                print( tab, (WebServiceMETHODMetadata) element );
+            }else if ( element instanceof WebServicePARAMETERMetadata ) {
+                print( tab, (WebServicePARAMETERMetadata) element );
+            }
+        }
+    }
+
+    public static void print ( WebServiceMETHODMetadata webServiceMETHODMetadata ){
+        print( 0, webServiceMETHODMetadata );
+    }
+
+    public static void print ( int tab, WebServiceMETHODMetadata webServiceMETHODMetadata ){
+        if(webServiceMETHODMetadata == null)
+            return;
+
+        print( tab, "<METHOD > > > > > >WebServiceMETHODMetadata");
+        print( tab, "wmOperationName", webServiceMETHODMetadata.getWmOperationName());
+        print( tab, "wmAction", webServiceMETHODMetadata.getWmAction());
+        print( tab, "oneway", webServiceMETHODMetadata.isOneWay() ? "true" : "false");
+        print( tab, "wrName", webServiceMETHODMetadata.getWrName());
+        print( tab, "javaMethodName", webServiceMETHODMetadata.getJavaMethodName());
+        print( tab, "javaReturnType", webServiceMETHODMetadata.getJavaReturnType());
+
+        //print( tab, "DwRequestElement");
+        //print( tab, webServiceMETHODMetadata.getDwRequestElement() );
+        //print( tab, webServiceMETHODMetadata.getDwResponseElement() );
+
+        //print( tab, "DwResponseElement");
+        //print( tab, webServiceMETHODMetadata.getSoapBinding() );
+        //print( tab, webServiceMETHODMetadata.getSecurityRoles() );
+
+        print("");
+
+        tab++;
+
+        print( tab, webServiceMETHODMetadata.getParams() );
+
+    }
+
+    public static void print ( WebServicePARAMETERMetadata webServicePARAMETERMetadata ){
+        print( 0, webServicePARAMETERMetadata );
+    }
+
+    public static void print ( int tab, WebServicePARAMETERMetadata webServicePARAMETERMetadata ){
+        if(webServicePARAMETERMetadata == null)
+            return;
+
+        print( tab, "<PARAM > > > > > > > > >WebServicePARAMETERMetadata");
+        print( tab, "wpName"     , webServicePARAMETERMetadata.getWpName());
+        print( tab, "wpMode"     , webServicePARAMETERMetadata.getWpMode());
+        print( tab, "wpHeader"   , webServicePARAMETERMetadata.isWpHeader() ? "true" : "false" );
+        print( tab, "javaType"   , webServicePARAMETERMetadata.getJavaType());
+        //print( "defaultName", webServicePARAMETERMetadata.getDefaultName());
+
+        print("");
+    }
+
+    public static void print ( SOAPBindingInfo soapBindingInfo ){
+        print( 0, soapBindingInfo );
+    }
+
+    public static void print ( int tab, SOAPBindingInfo soapBindingInfo ){
+        if(soapBindingInfo == null)
+            return;
+
+        print( tab, ">SOAPBindingInfo");
+        print( tab, "style" , soapBindingInfo.getStyle() );
+        print( tab, "use"   , soapBindingInfo.getUse() );
+        print( tab, "style" , soapBindingInfo.getParameterStyle() );
+    }
+
+    public static void print ( SecurityRolesInfo securityRolesInfo ){
+        print( 0, securityRolesInfo);
+    }
+
+    public static void print ( int tab, SecurityRolesInfo securityRolesInfo ){
+        if(securityRolesInfo == null)
+            return;
+
+        print( tab, ">SecurityRolesInfo");
+        print( tab, "rolesAllowed");
+        for( String role : securityRolesInfo.getRolesAllowed()){
+            print(tab, " " + role);
+        }
+        print( tab, "rolesReferenced");
+        for( String role : securityRolesInfo.getRolesReferenced()){
+            print(tab, " " + role);
+        }
+
+    }
+
+    public static void print (int tab, String msg, Object data ) {
+        print( tab,  msg + " : " + data);
+    }
+
+    public static void print (int tab, String msg ) {
+        print( TABS[tab] + msg );
+    }
+
+    public static void print ( String msg ) {
+        System.out.println( msg );
+    }
+
+
+}

Modified: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/processor/apt/WsmAnnotationProcessor.java
==============================================================================
--- incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/processor/apt/WsmAnnotationProcessor.java	(original)
+++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/processor/apt/WsmAnnotationProcessor.java	Mon Oct 11 10:15:35 2004
@@ -82,11 +82,20 @@
             // todo: log warning/error "@WebService" not defined (should never happen)
         }
 
-        // create & store object model
-         AnnotationModel objectModel =
-            getWebServiceTYPEMetadata((TypeDeclaration) decl);
+        AnnotationModel objectModel = null;
+        if ( decl instanceof ClassDeclaration )
+        {
+            // create & store an object model of the service implemetation bean
+
+            objectModel = getWebServiceTYPEMetadata((TypeDeclaration) decl, true);
+            objectModel = handleEndpointInterface((WebServiceTYPEMetadata) objectModel);
+        }
+        else
+        {
+            // create & store an object model of the service endpoint interface
 
-        objectModel = handleEndpointInterface((WebServiceTYPEMetadata) objectModel);
+            objectModel = getWebServiceTYPEMetadata((TypeDeclaration) decl, false);
+        }
 
         objectModels.put(((TypeDeclaration) decl).getQualifiedName(), objectModel);
     }
@@ -288,15 +297,28 @@
         return objectModels.keySet();
     }
 
-    protected WebServiceTYPEMetadata getWebServiceTYPEMetadata(TypeDeclaration decl)
+    // isImplemetationBean indicates the specified decl is a declaration of whether the service implementation bean
+    //    or the service endpoint interface.
+    protected WebServiceTYPEMetadata getWebServiceTYPEMetadata(TypeDeclaration decl, boolean isImplementationBean)
     {
         // get webService's webMethods
         Collection<WebServiceMETHODMetadata> webMethods =
             new ArrayList<WebServiceMETHODMetadata>();
+
         for ( MethodDeclaration methodDecl : decl.getMethods() )
         {
-            if (null != methodDecl.getAnnotation(javax.jws.WebMethod.class))
+            if ( isImplementationBean )
+            {
+                // Methods annotated with @WebMethod in the service implementation bean are exposed.
+                if (null != methodDecl.getAnnotation(javax.jws.WebMethod.class))
+                {
+                    webMethods.add(getWebServiceMETHODMetadata(methodDecl));
+                }
+            }
+            else
             {
+                // All methods declared in the service endpoint interface are exposed.
+                // (Doesn't matter annotated with @WebMethod or not. anyway all methods)
                 webMethods.add(getWebServiceMETHODMetadata(methodDecl));
             }
         }
@@ -330,10 +352,7 @@
             new ArrayList<WebServicePARAMETERMetadata>();
         for ( ParameterDeclaration paramDecl : decl.getParameters() )
         {
-//            if (null != paramDecl.getAnnotation(javax.jws.WebParam.class))
-//            {
-                webParams.add(getWebServicePARAMETERMetadata(paramDecl));
-//            }
+            webParams.add(getWebServicePARAMETERMetadata(paramDecl));
         }
 
         // create & return webMethod
@@ -367,10 +386,6 @@
         try {
             Collection<Annotation> annotations = getAnnotations(decl);
             wspm = new WebServicePARAMETERMetadata(
-//                (javax.jws.WebParam)AnnotationModel.getAnnotationOfType(
-//                    annotations,
-//                    javax.jws.WebParam.class
-//                ),
                 classForName(decl.getType()),
                 decl.getSimpleName(),
                 annotations

Modified: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/processor/reflection/WsmReflectionAnnotationProcessor.java
==============================================================================
--- incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/processor/reflection/WsmReflectionAnnotationProcessor.java	(original)
+++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/processor/reflection/WsmReflectionAnnotationProcessor.java	Mon Oct 11 10:15:35 2004
@@ -34,6 +34,8 @@
 import org.apache.beehive.wsm.jsr181.model.WebServiceTYPEMetadata;
 import org.apache.beehive.wsm.jsr181.model.AnnotationModel;
 
+import org.apache.beehive.wsm.jsr181.processor.ProcessorException;
+
 public class WsmReflectionAnnotationProcessor {
 
     /**
@@ -46,6 +48,13 @@
 
     public static WebServiceTYPEMetadata getObjectModel(Class clazz)
     {
+        return getObjectModel(clazz, true);
+    }
+
+    // isImplementationBean indicates the specified clazz is whether a service implementation bean or
+    //     service endpoint interface.
+    public static WebServiceTYPEMetadata getObjectModel(Class clazz, boolean isImplementationBean)
+    {
         WebService wsAnnotation;
         if (null == (wsAnnotation = (WebService) clazz.getAnnotation(WebService.class))) // no @WebService
         {
@@ -60,9 +69,10 @@
             WebMethod webMethodAnnotation = method.getAnnotation(WebMethod.class);
 
             //method is a webmethod
-            if (webMethodAnnotation != null)
+            if ( isImplementationBean && (webMethodAnnotation == null) )
             {
                 // get all parameters
+/*
                 List<WebServicePARAMETERMetadata> params =
                     new ArrayList<WebServicePARAMETERMetadata>();
                 int offset = 0;
@@ -100,8 +110,58 @@
                     t.printStackTrace(); // todo proper error handling
                     return null;
                 }
+ */
+                // This method is declared in a service implementation bean, but not annotated with @WebMethod.
+                // Thus, this method will not be exposed.
+                continue;
+            }
+
+            // get all parameters
+            List<WebServicePARAMETERMetadata> params =
+                new ArrayList<WebServicePARAMETERMetadata>();
+            int offset = 0;
+            Class< ? >[] methodParamTypes = method.getParameterTypes();
+            Annotation[][] allAnnotations = method.getParameterAnnotations();
+            for (Class paramType : methodParamTypes)
+            {
+                List<Annotation> allParmAnnotation =
+                    Arrays.asList(allAnnotations[offset]);
+                WebParam wpAnnotation =
+                    (WebParam)AnnotationModel.getAnnotationOfType(allParmAnnotation, WebParam.class);
+                WebServicePARAMETERMetadata paramMetaData =
+                    new WebServicePARAMETERMetadata(
+                        paramType,
+                        "in" + offset,   // by default parameter should be IN
+                        allParmAnnotation // class
+                    );
+                // reflection
+                // doesn't keep the
+                // name of
+                // the parameter
+                params.add(paramMetaData);
+                offset++;
+            }
+
+            try {
+                WebServiceMETHODMetadata wsmm =
+                    new WebServiceMETHODMetadata(
+                        webMethodAnnotation,
+                        method.getName(),
+                        method.getReturnType(),
+                        (0 < method.getExceptionTypes().length),
+                        Arrays.asList(method.getAnnotations()),
+                        params
+                    );
+                webMethods.add(wsmm);
             }
+            catch (Throwable t)
+            {
+                t.printStackTrace(); // todo proper error handling
+                return null;
+            }
+
         }
+
         WebServiceTYPEMetadata wstm = null;
         try {
             wstm = new WebServiceTYPEMetadata(
@@ -115,6 +175,97 @@
         {
             t.printStackTrace(); // todo proper error handling
         }
+
+        try{
+            // check the service endpoint interface only for the service implementation bean.
+            if( isImplementationBean ){
+                wstm = handleEndpointInterface(wstm);
+            }
+        }catch (Throwable t)
+        {
+            t.printStackTrace(); // todo proper error handling
+        }
+
         return wstm;
+    }
+
+    // copied from WsmAnnotationProcessor and removed a search funcitionality of source files.
+    public static WebServiceTYPEMetadata handleEndpointInterface(WebServiceTYPEMetadata webServiceTYPEMetadata)
+        throws ClassNotFoundException
+    {
+        String endpointInterface = webServiceTYPEMetadata.getWsEndpointInterface();
+        if (null == endpointInterface || 0 == endpointInterface.length())
+        {
+            return webServiceTYPEMetadata;
+        }
+
+        // the endpoint interface is specified by this webServiceTYPEMetadata.
+        // Thus, load it.
+
+        String canonicalSourcePath = null;
+        WebServiceTYPEMetadata endpointInterfaceMetadata = null;
+
+        if (endpointInterface.endsWith(".java"))
+        {
+            /* Not implemented.
+            // a java SOURCE file is specified for the endpoint interface.
+            // Thus, load annotations from it.
+            canonicalSourcePath = findSourceFile ( endpointInterface );
+            readServiceEndpointInterface(canonicalSourcePath);
+
+            // create a class name of the endpoint interface from the java source path.
+            String endpointInterfaceClassName =
+                endpointInterface.substring(0, endpointInterface.indexOf(".java"));
+            // path to class name
+            endpointInterfaceClassName =
+                endpointInterfaceClassName.replaceAll("/",".").replaceAll("\\",".");
+
+            endpointInterfaceMetadata =
+                (WebServiceTYPEMetadata)objectModels.get(endpointInterfaceClassName);
+            */
+        }
+        else
+        {
+
+            endpointInterfaceMetadata =
+                    getObjectModel( Class.forName(endpointInterface) , false);
+
+            /* Not implemented.
+            // a java CLASS file is specified for the endpoint interface.
+            // First, try to find the corresponding java source file.
+            canonicalSourcePath = findSourceFile ( endpointInterface );
+
+            if (null != canonicalSourcePath)
+            {
+                readServiceEndpointInterface(canonicalSourcePath);
+                endpointInterfaceMetadata =
+                    (WebServiceTYPEMetadata)objectModels.get(endpointInterface);
+            }
+            else
+            {
+                // the source file was not found. thus, load the class with
+                //  reflection and get annotations from it.
+                endpointInterfaceMetadata =
+                    createObjectModelWithReflection(endpointInterface);
+            }
+            */
+        }
+
+        if (null == endpointInterfaceMetadata)
+        {
+            // The endpoint interface is specified, but couldn't be found !
+            // todo: Must throw an Exception but just return the original
+            //     webServiceTYPEMetadata for now.
+            return webServiceTYPEMetadata;
+        }
+
+        endpointInterfaceMetadata.setWsServiceName(
+            webServiceTYPEMetadata.getWsServiceName()
+        );
+        endpointInterfaceMetadata.setWsEndpointInterface(
+            webServiceTYPEMetadata.getWsEndpointInterface()
+        );
+
+        return endpointInterfaceMetadata;
     }
 }