From: Manuel L. <ml...@li...> - 2004-03-31 20:26:22
|
hi, i waited a long time for this, now it works, thanks ! ( I thought i did something wrong). The current CVS-PHP example didn'd work. Here is my working version: $method="query"; $myStruct=new xmlrpcval(array("hacker" => new xmlrpcval("test","string")), "struct"); $options = new xmlrpcval(array("OutputKeys.INDENT" => new xmlrpcval("yes","string"), "OutputKeys.ENCODING" => new xmlrpcval("UTF-8", "string"), "variables" => $myStruct), "struct"); $msg=new xmlrpcmsg($method, array(new xmlrpcval($xquery,"string"), new xmlrpcval($howmany,"int"), new xmlrpcval($start,"int"), $options)); return $this->sendMsg($msg); manuel "Wolfgang Meier" <wol...@ex...> schrieb im Newsbeitrag news:200...@ex...... > Hi, > > I finally added support for passing variables to the XMLRPC query methods (see > CVS). Variable declarations are read from the "variables" field in the > optional struct that can be passed to the corresponding methods. Of course, > you can only pass variable values whose type is supported by XMLRPC. Here's > an example in Ruby: > > query = <<END > for \$speech in //SPEECH[LINE &= \$query] > order by \$speech/SPEAKER[1] > return > \$speech > END > > client = XMLRPC::Client.new("localhost", "/exist/xmlrpc", 8080) > > vars = { "query" => "adrian*" } > outputOptions = { "encoding" => "UTF-8", "indent" => "yes", > "variables" => vars > } > begin > result = client.call("query", query, 20, 1, outputOptions) > puts "#{result}\n" > > rescue XMLRPC::FaultException => e > puts "An error occurred:" > puts e.faultCode > puts e.faultString > end > > The REST server doesn't cache queries at all. I still have to add that. > > Wolfgang > > On Saturday 27 March 2004 15:29, Manuel Lautenschlager wrote: > > hi, > > > > i compared rest and xmlrpc. it seems, that rest xqueries aren't cache. rest > > is faster than xml-rpc the first time, but then it is slower. > > how can i pass variables via xmlrpc/rest/soap so i can access then via > > request:get-request-data ? > > > > I am just trying to optimize the perfomance. the last cvs update did a lot. > > But i think, when i pass the variables via post, all queries will be > > cached. Am i right with this ? > > > > thankyou for help, > > > > manuel > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click |