Hello All.
I am trying to create a Zend_Rest_Server but it is not working and always return a response like that:
<rest generator="zend" version="1.0">
<response>
<message>An unknown error occured. Please try again.</message>
</response>
<status>failed</status>
</rest>
Does anyone have some example? i think i am doing someting wrong but i am following the Documentation and i do not know where i can look for other tutorial/ code example.
Below follow the sources:
Server:
public function indexAction()
{
$this->_helper->viewRenderer->
--
adler medrado
Consultor
Zend Certified Engineer #ZEND003922
http://www.adlermedrado.com.br
I am trying to create a Zend_Rest_Server but it is not working and always return a response like that:
<rest generator="zend" version="1.0">
<response>
<message>An unknown error occured. Please try again.</message>
</response>
<status>failed</status>
</rest>
Does anyone have some example? i think i am doing someting wrong but i am following the Documentation and i do not know where i can look for other tutorial/ code example.
Below follow the sources:
Server:
public function indexAction()
{
$this->_helper->viewRenderer->
setNoRender();
$this->_helper->layout->disableLayout();
$server = new Zend_Rest_Server();
$server->setClass('Example');
$server->handle();
}
Client:
public function clientAction()
{
$this->_helper->viewRenderer->setNoRender();
$this->_helper->layout->disableLayout();
$client = new Zend_Rest_Client('http://localhost/form/index/index');
echo $client->hello('adler')->delete();
}
Example class:
class Example {
public function hello($nome)
{
return "Hello $nome";
}
}
$this->_helper->layout->disableLayout();
$server = new Zend_Rest_Server();
$server->setClass('Example');
$server->handle();
}
Client:
public function clientAction()
{
$this->_helper->viewRenderer->setNoRender();
$this->_helper->layout->disableLayout();
$client = new Zend_Rest_Client('http://localhost/form/index/index');
echo $client->hello('adler')->delete();
}
Example class:
class Example {
public function hello($nome)
{
return "Hello $nome";
}
}
--
adler medrado
Consultor
Zend Certified Engineer #ZEND003922
http://www.adlermedrado.com.br
没有评论:
发表评论