beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Proposal for continously testing JSR-181 functionality
Date Mon, 20 Sep 2004 03:12:25 GMT
Hi Michael, Jonathan

Michael, thank you for letting me know about test case/scenarios.
Now it's much clearer for me how I can cooperate with you guys.  :)

Jonathan, oh I didn't know that the DropInDeploymentHandler will be 
substituted for AnnotatedJWSHandler. Thanks for explaining me about the 

BTW, I'd been reading the source code of 
a couple of hours ago and got a tiny question.

How is the javax.jws.WebResult annotation treated ?

Here is the snippet from the constructor of WebServiceMETHODMetadata class.
    public WebServiceMETHODMetadata(javax.jws.WebMethod methodAnnotation,
            String javaMethodName, Class javaReturnType,
            Collection<Annotation> annotations, List< ? extends WebServicePARAMETERMetadata>
webParams) {

        if ((null == javaMethodName) || (null == javaReturnType)) {
            throw new IllegalArgumentException(
                    "javaMethodName or javaReturnType not set");

        // check required parameters
        if (null == methodAnnotation) {
            throw new IllegalArgumentException("@WebMethod is required");
        // set optional annotations
        for (Annotation a : annotations) {
             } else if (a.annotationType() == javax.jws.WebResult.class) {
                initFromAnnotation((javax.jws.WebResult) a);
At the bottom of the snippet, all annotations of this WebMethod are seached in the for-loop
if the javax.jws.WebResult annotation is found, the value of the name method of the WebResult
retrieved and is set into the instance variable named wrName.
But before doing that, "result" is already set into the wrName variable by setWrName() method

at the middle of the snippet.

It means that ...
1: If a method is not annotated with WebResult, the wrName will be "result".
2: if a method is annotated with @WebResult, the wrName will be "result".
3: If a method is annotated with @WebResult(name="myresult"), the wrName will be "myresult".

The 1st case, It's kinda foolproof, in case a developer forgets to add @WebResult annotation.
However, I think it might cause some unexpected results (that a developer doesn't intend).

My suggestion is that the WebResult annotation must appear with the WebMethod annotation.
or at least warn "you'd better to add WebResult" or something like that  during 
the development stage..

What u think ?

Thanks in advance.

I know it's a little thing. But I wanna get involved in this community fast so telling my
 and hear your ones.
Please don't get tired of it.  :)

View raw message