axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "R J Scheuerle Jr" <sc...@us.ibm.com>
Subject Re: Relationships between addParameter/setReturnType/invoke
Date Thu, 03 Jan 2002 20:48:25 GMT
Russell.

I think that call.invoke(...) should return a java.lang.Void object in the
second case, not null.
A null object could be confused with a real value, while java.lang.Void
clearly indicates that no return is available.

Here is the snippet of code again for clarity:

    call.addParameter(
        "var1",
        new XMLType(new QName("http://www.w3.org/1999/XMLSchema", "int")),
        Call.PARAM_MODE_OUT);
    call.addParameter(
        "var2",
        new XMLType(new QName("http://www.w3.org/1999/XMLSchema", "int")),
        Call.PARAM_MODE_OUT);

    Object ret = call.invoke(...);
    Map output = call.getOutputParams();

Comments?

Rich Scheuerle
XML & Web Services Development
512-838-5115  (IBM TL 678-5115)


                                                                                         
                 
                    Russell                                                              
                 
                    Butek/Austin/I       To:     axis-dev@xml.apache.org                 
                 
                    BM@IBMUS             cc:                                             
                 
                                         Subject:     Relationships between              
                 
                    01/03/2002            addParameter/setReturnType/invoke              
                 
                    01:58 PM                                                             
                 
                    Please respond                                                       
                 
                    to axis-dev                                                          
                 
                                                                                         
                 
                                                                                         
                 



There are a lot of problems with the Call object and parameters in the
JAX-RPC spec.  Now that I'm trying to implement the parameterOrder updates
in JAX-RPC, I'm running into some of these problems.  Here's one.
JAX-RPC's Call object, as of version 0.6, now has a getOutputParams method.
This is good.  We already found a need for one in AXIS and implemented it,
so the spec is getting closer to reality.  They're a little different - the
AXIS one returns a Vector while the JAX-RPC one returns a Map - but that's
easy to remedy.  But there's another question about this method and the
return from invoke.

Say we call:

    call.addParameter(
        "var1",
        new XMLType(new QName("http://www.w3.org/1999/XMLSchema", "int")),
        Call.PARAM_MODE_OUT);
    call.setReturnType(
        new XMLType(new QName("http://www.w3.org/1999/XMLSchema", "int")));

Then after calls to:

    Object ret = call.invoke(...);
    Map output = call.getOutputParams();

ret will be non-null and output would be a map that contains one element.

But if we did:

    call.addParameter(
        "var1",
        new XMLType(new QName("http://www.w3.org/1999/XMLSchema", "int")),
        Call.PARAM_MODE_OUT);
    call.addParameter(
        "var2",
        new XMLType(new QName("http://www.w3.org/1999/XMLSchema", "int")),
        Call.PARAM_MODE_OUT);

(notice there's no call to setReturnType) then after calls to:

    Object ret = call.invoke(...);
    Map output = call.getOutputParams();

I would expect ret to be null (since we didn't set a return type) and
output to be a map that contains two elements.  HOWEVER, our implementation
of Call ALWAYS returns the first resArgs element and puts the rest into the
outputParams Vector regardless of what addParameter/setReturnType calls
were made.

This seems wrong to me and I would like to fix it unless someone can
enlighten me on why I should leave it alone.

Russell Butek
butek@us.ibm.com





Mime
View raw message