Stano,
Thanks for the quick response. I did a lot of web searches but somehow missed the FAQ right there on the Apache web site.

I'll try out the decodeList since that will be cleaner. Your suggestion would also be a nice addition to the FAQ.

-Ken

Stanislav Miklik wrote:
Hi,

AFAIK, you are right, option A is the way how it works (see:
http://ws.apache.org/xmlrpc/faq.html#arrays)
My only advice, make small tooling, eg.

   public static List decodeList(Object element) {
      if (element == null) {
         return null;
      }
      if (element instanceof List) {
         return (List) element;
      }
      if (element.getClass().isArray()) {
         int length = Array.getLength(element);
         LinkedList result = new LinkedList();
         for (int i = 0; i < length; i++) {
            result.add (Array.get(element, i));
         }
         return result;
      }
      return null;
   }

With such method you can have option B.

Best regards
Stano

On Wed, Jul 8, 2009 at 23:37, Ken Tanaka <ken.tan...@noaa.gov> wrote:

I'm using an xmlrpc-client 3.1.2 application to talk to an xmlrpc-server
3.1.2 server and want to pass an array of strings. I figure people on this
list must have done this before.
...

Reply via email to