XML error with cakephp 2.3.0 stable

anton2

New Member
am trying to pass xml to a rest API am building with cakephp 2.3.0 and am getting an error yet i made it work with cakephp 1.3. Am wondering whether the problem is with the XML core utility of cakephp.The XML string am posting is as below\[code\]<?xml version="1.0" encoding="UTF-8"?><username>my username</username><password>mypassword</password><name>Namanya Hillary</name><title>mytitle</title>\[/code\]And the Error is as below\[code\]2013-01-31 07:32:25 Error: [Exception] String could not be parsed as XML#0 E:\wamp\www\cakephp2.3.0\lib\Cake\Utility\Xml.php(131): SimpleXMLElement->__construct('<?xml version="...', 16384)#1 E:\wamp\www\cakephp2.3.0\lib\Cake\Utility\Xml.php(100): Xml::_loadXml('<?xml version="...', Array)#2 E:\wamp\www\cakephp2.3.0\lib\Cake\Controller\Component\RequestHandlerComponent.php(222): Xml::build('<?xml version="...')#3 [internal function]: RequestHandlerComponent->convertXml('<?xml version="...')#4 E:\wamp\www\cakephp2.3.0\lib\Cake\Network\CakeRequest.php(828): call_user_func_array(Array, Array)#5 [internal function]: CakeRequest->input(Array)#6 E:\wamp\www\cakephp2.3.0\lib\Cake\Controller\Component\RequestHandlerComponent.php(207): call_user_func_array(Array, Array)#7 [internal function]: RequestHandlerComponent->startup(Object(CompaniesController))#8 E:\wamp\www\cakephp2.3.0\lib\Cake\Utility\ObjectCollection.php(131): call_user_func_array(Array, Array)#9 [internal function]: ObjectCollection->trigger(Object(CakeEvent))#10 E:\wamp\www\cakephp2.3.0\lib\Cake\Event\CakeEventManager.php(247): call_user_func(Array, Object(CakeEvent))#11 E:\wamp\www\cakephp2.3.0\lib\Cake\Controller\Controller.php(670): CakeEventManager->dispatch(Object(CakeEvent))#12 E:\wamp\www\cakephp2.3.0\lib\Cake\Routing\Dispatcher.php(183): Controller->startupProcess()#13 E:\wamp\www\cakephp2.3.0\lib\Cake\Routing\Dispatcher.php(161): Dispatcher->_invoke(Object(CompaniesController), Object(CakeRequest), Object(CakeResponse))#14 E:\wamp\www\forex\webroot\index.php(102): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))#15 {main}\[/code\]I tried passing the XML directly in the core XML utility file in the utility folder as below on line 130\[code\]$xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><username>my username</username><password>mypassword</password><name>Namanya Hillary</name><title>mytitle</title>', LIBXML_NOCDATA);\[/code\]but the same exception is being raised. Please help me if u have encountered such a problem or if u see any mistake made. Reference links to solutions will be useful. Thanks in-advance.
 
Back
Top