ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric BOYER <Eric.Bo...@insa-toulouse.fr>
Subject Re: How to use Vector or Hashtable from a PHP Client
Date Wed, 22 Mar 2006 10:01:25 GMT

>
>  
>
>>---------------
>>Client :
>>$myArray = new xmlrpcval(
>>  array(
>>    1 => new xmlrpcval("Tom"),
>>    3 => new xmlrpcval("Dick"),
>>    5 => new xmlrpcval("Harry")
>>  ),
>>  "array");
>>    
>>
>
>Are you sure, this is an array and not a "struct"?
>I would write an array as
>  new xmlrpcval(array(
>    new xmlrpcval("Tom"),
>    new xmlrpcval("Dick"),
>    new xmlrpcval("Harray")), "array");
>  
>
my problem comes from my PHP Client.
with

$myArray = new xmlrpcval(
  array(
    1 => new xmlrpcval("Tom"),
    3 => new xmlrpcval("Dick"),
    5 => new xmlrpcval("Harry")
  ),
  "array");

you are suppose to receive an Hashtable

with

new xmlrpcval(array(
    new xmlrpcval("Tom"),
    new xmlrpcval("Dick"),
    new xmlrpcval("Harray")), "array");

You are suppose to receive a vector

>  
>
>>executerRequeteHTTP("testVector",$myArray);
>>    
>>
>
>  
>
>>function executerRequeteHTTP($nomMethode,$args) {
>>  include("./config.php");
>>  // construction du client
>>  $client=new xmlrpc_client($server_path,$server_hostname,$server_port);
>>  $message=new xmlrpcmsg($nomMethode,$args);
>>    
>>
>
>Also when I work with the PHP implementation, I do something like
>    $message = new xmlrpcmsg($nomMethode, array($args));
>  
>
i'll try it

>since the constructor of xmlrpcmsg expects an array as the parameter
>list. If I understand the code behind the constructor, the parameter
>list would be empty if the argument is null or not an array, like
>you have seen in your tcpdump.
>



Mime
View raw message