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 How to use Vector or Hashtable from a PHP Client
Date Tue, 21 Mar 2006 15:35:53 GMT
Hello

I wan't to use a client PHP XMLRPC with my Java server XMLRPC.

For simple type, all works fine.

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");
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);
  $result=$client->send($message,0,'http');
  if (!$result->faultCode()) {
    $result=$result->value();
    $tab=xmlrpc_decode($result);
  }
  else {
    fatalError($result);
  }
  return $tab;
}

---------------
Server :
    public void testVector(Vector vec) {
        System.out.println("testVector(vec)");
        System.out.println("vec : "+vec);
    }
 
    public String testVector() {
        System.out.println("testVector()");
        return "OK";
    }
---------------


testVector() is always executed and I don't know why ...

Could you help me ?

thanks,
BOYER Eric



Mime
View raw message