Results 1 to 3 of 3
  1. #1
    kez
    kez is offline Member
    Join Date
    Aug 2008
    Posts
    2
    Rep Power
    0

    Default XML-RPC Apach Client

    Hello!
    Im need help.
    I can not disassemble the answer of a server

    my client
    Java Code:
           XmlRpcClient client = new XmlRpcClient();
            client.setConfig(config);             
    
            ArrayList<String> list =new ArrayList<String>();       
            list.add("prNew");               
                   
            HashMap<String, ArrayList<String>> hashMap = new HashMap<String, ArrayList<String>>();
            hashMap.put("targets", list);
           
            try {           
             
                Object[] a= (Object[])client.execute("xds.load_targets", new Object[]{hashMap});
                System.out.println(a[0]);                       
    
            } catch (XmlRpcException ex) {
                Logger.getLogger(XmlRpc.class.getName()).log(Level.SEVERE, null, ex);
            }
    on

    Java Code:
    Object[] a= (Object[])client.execute("xds.load_targets", new Object[]{hashMap});
    the server answers

    Java Code:
    {cookie=65EB123E121D2229F39992686WA8CEEC, id=13, desc=lalala, name=prNew, rowset=[Ljava.lang.Object;@7a5a19, header=[Ljava.lang.Object;@b122a1}
    How to disassemble the answer?

    There is a scheme that I should receive
    Code:

    Java Code:
    [ { "name":    <target_name>:str,
          "desc":    <target_title>:str,
    
          "header":  [ { "name":       <field_name>:str,
                         "desc":       <field_title>:str,
                         "vision":     <widget_type>:str,
                         "validator":  <validation_rule>:str,
                         "variants":   [ { "name":  <variant_name>:str,
                                           "desc":  <variant_title>:str } ... ],
                         "default":    <default_value>:str,
                         "bath":       <bath_route_rules>:str } ... ],
    
          "rowset":  [ { "name":       <column_name>:str,
                         "desc":       <column_title>:str,
                         "validator":  <validation_rule>:str,
                         "bath":       <bath_route_rules>:str } ... ],
    
          "cookie":  <magic_cookie>:str } ... ]
    Hands fall(

  2. #2
    mrcheeks is offline Member
    Join Date
    Jan 2008
    Posts
    22
    Rep Power
    0

    Default

    Well when you see java.lang.blalblabh it is an object. For need to cast your arrays and iterate on them to extract values.

  3. #3
    kez
    kez is offline Member
    Join Date
    Aug 2008
    Posts
    2
    Rep Power
    0

Similar Threads

  1. ThinkUI SQL Client 1.0.5
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 03-27-2008, 03:06 PM
  2. UDP Client help
    By misslilbit02 in forum Advanced Java
    Replies: 0
    Last Post: 03-09-2008, 08:31 PM
  3. Identify Client in Socket Client Server Application
    By masadjie in forum Networking
    Replies: 1
    Last Post: 12-20-2007, 10:18 AM
  4. ThinkUI SQL Client 1.0.1
    By levent in forum Java Software
    Replies: 0
    Last Post: 07-26-2007, 09:18 PM
  5. client for PERFORCE
    By Ed in forum New To Java
    Replies: 2
    Last Post: 07-02-2007, 08:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •