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 Jia Yiyu <yy...@nowmediatech.com> on 2004/10/07 14:34:17 UTC

Can Hashtable object be used as parameter of RPC?

Hello everybody,

I am trying to use java.util.Hashtable or java.util.Properties class as
parameters of my RPC methods. But I got "java.lang.ClassCastException" on
the server side and , of course, my client side calling was failure. I see
some application use Vector object as RPC method's parameter. But why do I
get ClassCastException?

I feel strange because both Hashtable and Properties classes have
implemented the java.io.Serializable interface already. And the "key" and
"value" in the Hashtable or Properties are all java.lang.String object.

Hence, can we use objects of java.util.Properties and java.util.Hashtable as
RPC methods' parameters?

Thanks in advance for response!

	Jia Yiyu




RE: Can Hashtable object be used as parameter of RPC?

Posted by Jia Yiyu <yy...@nowmediatech.com>.
Hi Andrea,

Thank  you for your reply! So, it seems that the problem is from my own
code. But may I ask you how you use Hashtable as parameter in RPC? Defining
the parameter's type as java.util.Hashtable directly or defining the
parameter as java.lang.Object and cast the object to be java.util.Hashtable
object on the server side?

Best!

	Jia Yiyu

-----Original Message-----
From: Andrea Fabris [mailto:cavaliereoscuro@email.it]
Sent: Thursday, October 07, 2004 9:04 PM
To: axis-user@ws.apache.org
Subject: Re: Can Hashtable object be used as parameter of RPC?


Hi Jia!
We succefully use Axis 1.1 RPC services that use hashtable as parameters
(both in and out). However you have to be careful about
interoperability, because SOAP client written in other language (such as
Perl and C/C++) can't handle in the right way nested maps.

Regards
Andrea Fabris

On 07/10/2004 14.34, Jia Yiyu wrote:

>Hello everybody,
>
>I am trying to use java.util.Hashtable or java.util.Properties class as
>parameters of my RPC methods. But I got "java.lang.ClassCastException" on
>the server side and , of course, my client side calling was failure. I see
>some application use Vector object as RPC method's parameter. But why do I
>get ClassCastException?
>
>I feel strange because both Hashtable and Properties classes have
>implemented the java.io.Serializable interface already. And the "key" and
>"value" in the Hashtable or Properties are all java.lang.String object.
>
>Hence, can we use objects of java.util.Properties and java.util.Hashtable
as
>RPC methods' parameters?
>
>Thanks in advance for response!
>
>	Jia Yiyu
>
>
>
>
>


Re: Can Hashtable object be used as parameter of RPC?

Posted by Andrea Fabris <ca...@email.it>.
Hi Jia!
We succefully use Axis 1.1 RPC services that use hashtable as parameters 
(both in and out). However you have to be careful about 
interoperability, because SOAP client written in other language (such as 
Perl and C/C++) can't handle in the right way nested maps.

Regards
Andrea Fabris

On 07/10/2004 14.34, Jia Yiyu wrote:

>Hello everybody,
>
>I am trying to use java.util.Hashtable or java.util.Properties class as
>parameters of my RPC methods. But I got "java.lang.ClassCastException" on
>the server side and , of course, my client side calling was failure. I see
>some application use Vector object as RPC method's parameter. But why do I
>get ClassCastException?
>
>I feel strange because both Hashtable and Properties classes have
>implemented the java.io.Serializable interface already. And the "key" and
>"value" in the Hashtable or Properties are all java.lang.String object.
>
>Hence, can we use objects of java.util.Properties and java.util.Hashtable as
>RPC methods' parameters?
>
>Thanks in advance for response!
>
>	Jia Yiyu
>
>
>
>  
>