The library only supports Vector and Hashtable (see http://ws.apache.org/xmlrpc/types.html).

Jimisola

----- Original Message ----- From: "Eric BOYER" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, October 03, 2005 12:05 PM
Subject: LinkedHahMap for parameters


Hello,

I would like to use LinkedHashMap for parameters :

My client :

Vector params = new Vector();
LinkedHashMap lhm = new LinkedHashMap();
lhm.put("toto","titi");
params.add(lhm);
       try{
           System.out.println(client.execute("bonjour.testHashtable",params));
       }
       catch (Exception ex) {
           System.err.println("Error: " + ex.getMessage());
       }

I have got a :
Avoiding obscuring previous error by supressing error encountered while ending request: org.apache.xmlrpc.XmlRpcClientException: Exception closing URLConnection
Error: Failure writing request

-----------------------------
I tried to put the LHM in a vector :
Vector vec=new Vector();
vec.add(lhm);
params.add(vec);

Exactly the same error !

Can't we use HashMap for parameters ?

-----------
My serveur methods are :
   public Vector testHashtable(LinkedHashMap lhm) {
       System.out.println("Taille LHM :"+ lhm.size());
      return new Vector();
       //    return hash;
      }
   public Vector testHashtable(Vector vec) {
       System.out.println("Taille vec :"+ vec.size());
      return new Vector();
       //    return hash;
      }


And All is nice working with simple types (same for vector, exept when vector contain a LHM).

Otherwise, for a return value, I use LHM nicely :o(

Thanks for your help

Eric





Reply via email to