|
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); }
|
- XUpdate PHP API Umesh Rathod
- David Viner
