> Hi I want to use the same Zend_Rest_Client to do multiple calls to the
> same web service but with different methods.
>
> In version 1.6.2 I was able to do this. But in version 1.7 The second
> call just returns the result of the first call.
>
> Do I always have to create a new client? Or can I reset it's state. It's
> not clear from the reference guide.
>
> Thanks, Meloen
The following calls return the same result:
<?php
require_once('Zend/Rest/Client.php');
$client = new Zend_Rest_Client("http://localhost/service.php");
$moo = $client->getMoo(66)->get();
print_r($moo);
$moo = $client->getBlah(88)->get();
print_r($moo);
?>
These calls do work, but behaviour is different with Zend framework 1.6.2:
$moo = $client->getMoo()->testid(44)->get();
print_r($moo);
$moo = $client->getBlah()->testid(55)->get();
print_r($moo);
service.php:
<?php
$server = new Zend_Rest_Server();
$server->setClass('Blah');
$server->handle();
class Blah
{
function getBlah($testid)
{
return 'Blah';
}
function getMoo($testid)
{
return 'moo';
}
}
?>
没有评论:
发表评论