axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kraicho Kraichev (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Created: (AXIS-1693) RPCElement constructor incorrectly sets param name to "arg0", "arg1", etc.
Date Wed, 01 Dec 2004 13:40:20 GMT
RPCElement constructor incorrectly sets param name to "arg0", "arg1", etc.
--------------------------------------------------------------------------

         Key: AXIS-1693
         URL: http://nagoya.apache.org/jira/browse/AXIS-1693
     Project: Axis
        Type: Bug
  Components: Serialization/Deserialization  
    Versions: 1.1    
 Environment: Windows XP
IBM Java Virtual Machine version 1.4.2
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM Windows 32 build cn142-20040926 (JIT ena
bled: jitc))
    Reporter: Kraicho Kraichev


When serializing a SOAP message an org.apache.axis.message.RPCElement object is created using
the "public RPCElement(String namespace, String methodName, Object [] args)" constructor.
When the "args" array contains an element which is of type RPCParam, then the name of the
argument as later serialized in the SOAP message is correct. 
When an element of the "args" array is NOT of type RPCParam, however, then the name of the
argument is set to:
"arg" + i, for example, "arg0", "arg1", etc.

The reason for this behavior can be seen if you look at the code of this RPCElement constructor:

    public RPCElement(String namespace, String methodName, Object [] args)
    {
        this.setNamespaceURI(namespace);
        this.name = methodName;

        for (int i = 0; args != null && i < args.length; i++) {
            if (args[i] instanceof RPCParam) {
                addParam((RPCParam)args[i]);
            } else {
                String name = null; // LOOK HERE!
                if (name == null) name = "arg" + i;
                addParam(new RPCParam(namespace, name, args[i]));
            }
        }
    }

See the "LOOK HERE!" comment that I've inserted?
The "name" local variable hides the "name" member variable and thus "name" is always null,
thus ending up with the "arg0" param name, when the "args" array element is not of type RPCParam.
I have fixed that issue (on my machine locally) by commenting out the "LOOK HERE!" line. In
this way the name of the argument is correctly handled.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message