You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Umesh Rathod <um...@treemedia.com> on 2002/06/14 19:45:10 UTC

XUpdate PHP API

Hi:
        Where can I find PHP API for XUpdate? I searched google but it was of no help.


Thanks,
Umesh

RE: XUpdate PHP API

Posted by David Viner <dv...@yahoo-inc.com>.
Hi,

    here's some code for calling queryDocument.  the code should allow for
both xpath and xupdate.  you can also find more php xindice client code at
sourceforge http://sourceforge.net/projects/phpxindice/



dave



function _communicate($server,$port,$collection,$msgStr,$msgArray,$debug=0)
{
$client = new xmlrpc_client($collection, $server,$port);
$rpcmsg = new xmlrpcmsg($msgStr,$msgArray);
if($debug != 0)
$client->setDebug(1);
$result = $client->send($rpcmsg);
if($result == 0)
return $client->errstr;
if(!$result->faultCode())
return $response = xmlrpc_decode($result->value());
else
return $response = xmlrpc_decode($result->faultString());
}



function queryDocument($server, $port,
$collection,$key,$type,$query,$debug=0)
{$methodName = "db.queryDocument";
$BlankArray = array();
$paramsArray = array(new xmlrpcval($collection, "string"),
new xmlrpcval($type, "string"),
new xmlrpcval($query, "string"),
new xmlrpcval($BlankArray,"struct"),
new xmlrpcval($key,"string"));
return
_communicate($server,$port,$collection,$methodName,$paramsArray,$debug);

}

  -----Original Message-----
  From: Umesh Rathod [mailto:umesh@treemedia.com]
  Sent: Friday, June 14, 2002 10:45 AM
  To: xindice-users@xml.apache.org
  Subject: XUpdate PHP API


  Hi:
          Where can I find PHP API for XUpdate? I searched google but it was
of no help.


  Thanks,
  Umesh