Re: struct of array of structs

"Manuel Fernández Campos" <[email protected]> Thu, 28 Sep 2006 18:37:46 +0200
Newsgroups gmane.text.xml.rpc.specification
Message-ID <[email protected]>
On 9/28/06, John Wilson <[email protected]> wrote:
>
>
>
>
>
>
>
>  On 28 Sep 2006, at 08:00, Manuel Fernández Campos wrote:
>
>  >
>  >
>  > I use the apache's Xmlprc library.
>  >
>  > Certainly, the struct is return as a HashMap but the array is return
>  > as java.lang.object and if  i try to turn in an array or a vector, one
>  > CastException is thrown.
>
>  Every object in Java is an instance of java.lang.Object :)

that already knew it ;)

>
>  Older versions of the Apache library returned XML-RPC arrays as
>  Vector. Newer versions return objects which implement the
>  java.util.List interface (the object is probably an instance of
>  java.util.arrayList). If you cast these objects to Vector or array
>  you will certainly get an Exception.

Yes, that is thus
>
>  Why not try what I suggested in my first message and cast it to a
>  List and call toArray on it to get an array of Object (or use the
>  version which takes an array parameter to get an array for some other
>  type)?

I don't understand this. what version?

>
>  If that fails call getClass().getName() on the object and print the
>  result out. That will tell you what the type of the object is.

Ok. The result is this: [Ljava.lang.Object;

It is the trouble! It is a simple object. it isn't of any type and any
cast throw an exception

Thanks for your time

Manuel Fernández

>
>  John Wilson
>  The Wilson Partnership
>  web http://www.wilson.co.uk
>  blog http://eek.ook.org
>
>                    


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/xml-rpc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/xml-rpc/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/