ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Taft <a...@hydroblaster.com>
Subject Re: Illegal argument
Date Thu, 22 Jun 2006 03:45:29 GMT
Zhi,

It should work, though I use an older version of the software.  It works
for me the way I've described.

Does anyone know what might be wrong for Zhi?

With regards to your other question, no the return doesn't have to be
wrapped in a Vector.  You can just return any valid XmlRpc type.  But,
by default, you can't return null/void.

Your ping method might look something like:

public boolean ping() {
  return true;
}

Or, maybe a string:

public String ping() {
  return "pong";
}

Adam


Han, Zhi (Zhi) wrote:
> It doesn't work.
> 
> Firstly, for the method
> public Vector abc(Vector v)
> {
> ...
> }
> 
> even on client side I try to
> Vector args = new Vector();
> args.add(new Vector());
> client.execute("handler.abc", args);
> 
> I still got "org.apache.xmlrpc.XmlRpcException: Illegal argument for method
> abc in class........"
> 
> Second,
> 
> For methods without argument, like
> public Vector ping()
> {
> ...
> }
> I try to 
> Vector args = new Vector()
> cleint.execute("handler.ping", args)
> 
> I got "org.apache.xmlrpc.XmlRpcException: Failed to invoke method ping in
> class .... :null"
> 
> Another question, for the return value of method ping, abc, ..., the vector
> should also be like that?
> 
> Vector val = new Vector()
> val.add(new Vector())
> return val
> 
> Thanks,
> 
> -----Original Message-----
> From: Adam Taft [mailto:adam@hydroblaster.com]
> Sent: Thursday, June 22, 2006 1:04 AM
> To: xmlrpc-user@ws.apache.org
> Subject: Re: Illegal argument
> 
> 
> Zhi,
> 
> Don't you need to:
> 
> Vector args = new Vector();
> args.add(new Vector());
> client.execute("handler.abc", args);
> 
> XmlRpcClient.execute() requires a Vector with a list of method arguments
> inside.  Since your handler method requires a vector, you need to embed
> a vector in a vector.
> 
> Or, to put it another way, with your execute invocation (below), it
> would work if your abc() method didn't have any arguments, like:
> 
> Vector public abc() { ... }
> 
> Adam
> 
> 
> Han, Zhi (Zhi) wrote:
>> I have a method abc in handler, like
>> Vector public abc (Vector v)
>> {
>>    ...
>> }
>>
>> Why I always get illegal argument exception for method abc
>>
>> On client side, I use
>>
>> client.execute("handler.abc", new vector());
>>
>> Thanks,
>>
>> Zhi
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: xmlrpc-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: xmlrpc-user-help@ws.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xmlrpc-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: xmlrpc-user-help@ws.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xmlrpc-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: xmlrpc-user-help@ws.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-user-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-user-help@ws.apache.org


Mime
View raw message