beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremiah Johnson" <jerjo...@bea.com>
Subject JSR-181 Spec Change
Date Mon, 08 Aug 2005 21:07:11 GMT
The JSR-181 specification has a change that hasn't been picked up yet in
the WSM implementation.  The change is about when a method is to be
exposed as a Web method.

--- JSR-181 v0.9.2 (Dec '04)
If the implementation bean does not implement a service endpoint
interface, it must include @WebMethod annotations on each method that is
to be exposed as a Web Service operation. More information on the
@WebMethod annotation may be found in section 5.2.
 
--- JSR-181 v1.0 (June '05)
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. This
behavior can be overridden by using the WebMethod annotation to specify
explicitly those public methods that are to be exposed. If a WebMethod
annotation is present, only the methods to which it is applied are
exposed.

Here is an example of a Web service that I would like to suggest as a
test case.  I put in comments to tell what I think the correct behavior
would be.  Based on the specification changes, do my comments look
correct?

---
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()";
    }

}
---

Since WSM was written before the 1.0 version of the spec, it is no
surprise that there is a difference between the implementation and 1.0.
Should WSM change to be consistent with 1.0 or stay with 0.9.2?

- jeremiah


Mime
View raw message