You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Sue Deng <sd...@covalent.net> on 2001/05/03 02:15:53 UTC

parameters

Hi,

It seems like soap server method take parameters by order instead of by
parameter name.  For example, we have server class like this:
public class logon {
  public String getLogonInfo(String username, String password){
    return "username= " username + " , password= " + password;
  }
}

In client, we have:
...............
Vector params=new Vector();
params.addElement(new Parameter("username", String.class, "abc", null)
params.addElement(new Parameter("password",  String.class, "123", null)

But if we add password first, and username second, the server will get
"123" as username, and "abc" as password.

Is there any way the server take parameters by parameter's name?

Thanks,

-Sue


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


RE: parameters

Posted by Silvio Fiorito <si...@ntr.net>.
The parameters in the request need to match the method prototype, so in
other words you need to pass the parameters in the same order as they are
defined.

Silvio

-----Original Message-----
From: sdeng@incoming2.eclipsetel.com
[mailto:sdeng@incoming2.eclipsetel.com]On Behalf Of Sue Deng
Sent: Wednesday, May 02, 2001 8:16 PM
To: soap-user@xml.apache.org
Subject: parameters


Hi,

It seems like soap server method take parameters by order instead of by
parameter name.  For example, we have server class like this:
public class logon {
  public String getLogonInfo(String username, String password){
    return "username= " username + " , password= " + password;
  }
}

In client, we have:
...............
Vector params=new Vector();
params.addElement(new Parameter("username", String.class, "abc", null)
params.addElement(new Parameter("password",  String.class, "123", null)

But if we add password first, and username second, the server will get
"123" as username, and "abc" as password.

Is there any way the server take parameters by parameter's name?

Thanks,

-Sue


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


RE: parameters

Posted by Silvio Fiorito <si...@ntr.net>.
The parameters in the request need to match the method prototype, so in
other words you need to pass the parameters in the same order as they are
defined.

Silvio

-----Original Message-----
From: sdeng@incoming2.eclipsetel.com
[mailto:sdeng@incoming2.eclipsetel.com]On Behalf Of Sue Deng
Sent: Wednesday, May 02, 2001 8:16 PM
To: soap-user@xml.apache.org
Subject: parameters


Hi,

It seems like soap server method take parameters by order instead of by
parameter name.  For example, we have server class like this:
public class logon {
  public String getLogonInfo(String username, String password){
    return "username= " username + " , password= " + password;
  }
}

In client, we have:
...............
Vector params=new Vector();
params.addElement(new Parameter("username", String.class, "abc", null)
params.addElement(new Parameter("password",  String.class, "123", null)

But if we add password first, and username second, the server will get
"123" as username, and "abc" as password.

Is there any way the server take parameters by parameter's name?

Thanks,

-Sue


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org