The doc and examples are quite clear (in my humble opinion) indicating that:
 
- the client->send() method returns an xmlrpcresp object
 
- the resp->value() method returns an xmlrpcval object (of course you should check for the error code first, to see if there was a communication error)
 
- xmlrpcval objects have some methods that can be used depending on their type. For structs and arrays, in particular:
 
  + for xmlrpcval of type array: val->arraysize(), val->arraymem()
  + for xmlrpcval of type struct:  val->structsize(), val->structmem(), val->structeach(), val->structreset(), val->structmemexixts(),
 
- there is also a second method to access the data of an xmlrpcval object, decoding it all-at-once into plain php values: $php_values = php_xmlrpc_decode($xmlrpcval);
 
here's a code snippet to get you running:
 
 $f = new xmlrpcmsg('system.methodSignature', array(new xmlrpcval(system.methodHelp));
 $c = new xmlrpc_client("/server.php", "phpxmlrpc.sourceforge.net", 80);
 $r = $c->send($f);
 if(!$r->faultCode())
 {
  $v = php_xmlrpc_decode($r->value());
  var_dump($v); // this will echo a standard php array. You can access it as you prefer
 
  $v = $r->value();
  $signum = $v->arraysize();
  for($i = 0; $i < $signum; $i++)
  {
   $sig = $v->arraymem($i);
   $paramsnums = $sig->arraysize()-1;
   $retval = $sig->arraymem(0);
   echo "Found a signature\n  Return type is: ".$retval->scalarval()."\n";
   for ($j = 1; $j <= $paramsnums; $j++)
   {
     $param = $sig->arraymem($j);
     echo "  Param number $j must be of type: ".$param->scalarval()."\n";
   }
  }

 }
 
PS: I think you might have a problem due to the linguistic barrier: what is your native language? I can answer in italian or french if you prefer...
 
Hope it helps
Gaetano
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Overpeer ---
Sent: Friday, February 03, 2006 10:32 AM
To: phpxmlrpc@lists.usefulinc.com
Subject: [phpxmlrpc] I'm Lost with phpxmlrpc

Hello all in my first message to the list.

I'm trying implement a simple webservice with xml-rpc, I´m make the client with phpxmlrpc on Apache2 on GNU/Linux.

The servers, is makes in Delphi and works OK, it send mi things like this:
<methodResponse>
<params>
<param>
<value><array>
<data>
<value><struct>
<member><name>ITI</name>
<value><string>311</string></value>
</member>
</struct></value>
<value><struct>
<member><name>ITI</name>
<value><string>310</string></value>
</member>
</struct></value>
<value><struct>
<member><name>ITI</name>
<value><string>312</string></value>
</member>
</struct></value>
</data>
</array></value>
</param>
</params>
</methodResponse>
Whats could be the logic structure to access the structures and arrays for procesing the data?? I has read the documentation but i can't find examples with clients and structures, and de commads explain don't be clear for me :|

A lot of thanks ;)
_______________________________________________
phpxmlrpc mailing list
phpxmlrpc@lists.usefulinc.com
http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc

Reply via email to