You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Russell Butek <bu...@us.ibm.com> on 2002/01/03 20:58:31 UTC

Relationships between addParameter/setReturnType/invoke

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