ZF-10847: ZEND + Restful service

Issue Type: Bug Created: 2010-12-18T18:52:06.000+0000 Last Updated: 2012-11-20T21:38:12.000+0000 Status: Open Fix version(s): Reporter: hervouet (christophe) Assignee: None Tags: - Zend_Rest_Client

  • Zend_Rest_Server

Related issues: Attachments:



Firstly sorry for my poor english I'm trying out RESTful services with Zend Framework and I encouter a problem when I run my client script

message = REST Response Error: simplexml_load_string() [<function.simplexml-load-string>]: ^

My best thanks if you could help me

my scripts : a)the service

setClass('CustomTestClass'); $server->handle(); exit; } }class CustomTestClass { /\*\* \* say Hello \* \* @param string $name \* @return string \*/ public function sayHello($name) { return "hello".$name; } } ?> b)the client sayHello($toto)->get(); if ($result->isSuccess()) { $this->view->result = $result; } } catch (Zend\_Exception $e) { $redacteur = new Zend\_Log\_Writer\_Stream("log-rest"); $logger->addWriter($redacteur); $logger->log("resultat service rest :".$prob."message :". $e->getMessage() ,Zend\_Log::INFO); } } } ?>Some more informations : When I run the URL view-source:[http://localhost/webs/test-rest/…](http://localhost/webs/test-rest/public/index.php/index/rest?method=sayHello&name=Davey) into Chrome , I can see no problems I use zend framework 1.1 I think that it have a problem to find the method sayHello My very best regards



Posted by Matthew Weier O'Phinney (matthew) on 2010-12-19T08:32:40.000+0000

As there is no ZF version 1.1, can you please copy and paste the value of Zend_Version::VERSION, please? We have both 1.10 and 1.11, but no 1.1.

Second, is SimpleXML enabled on your PHP installation? If so, can you cut and paste the XML generated by the service, and pass it into simplexml_load_string() to see if there are errors that occur? If so, we'll know then if there are issues with the XML generation of the REST server.

Third, I'd recommend not using Zend_Rest_Server, and instead using Zend_Rest_Route + Zend_Rest_Controller in your MVC. It's a much cleaner, more RESTful way to do REST services.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.