ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Theis <theis.n...@gmx.at>
Subject Re: How to use Vector or Hashtable from a PHP Client
Date Wed, 22 Mar 2006 10:01:11 GMT

Eric BOYER <Eric.Boyer@insa-toulouse.fr> wrote:

> But for type like array, my server java lose my parameters !
> How can I know if it comes from my PHP client or my Java server ?

> here is my code

> ---------------
> 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");

> 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));
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.

BTW, can you use tcpdump do monitor local network traffic under Windows?

But then, your simple types shouldn't work either.

>   $result=$client->send($message,0,'http');
>   if (!$result->faultCode()) {
>     $result=$result->value();
>     $tab=xmlrpc_decode($result);
>   }
>   else {
>     fatalError($result);
>   }
>   return $tab;
> }

Regards

Christoph Theis




Mime
View raw message