Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't parse chunked response while using Zend\XMLRpc\Client
    primarykey
    data
    text
    <p>I got error after upgrade zf 2.0.4 => 2.0.6</p> <pre><code>Zend\Http\Exception\RuntimeException File: D:\xampp\htdocs\htm\base\vendor\zendframework\zendframework\library\Zend\Http\Response.php:449 Message: Error parsing body - doesn't seem to be a chunked message Stack trace: #0 D:\xampp\htdocs\htm\base\vendor\zendframework\zendframework\library\Zend\Http\Response.php(303): Zend\Http\Response-&gt;decodeChunkedBody('???????????????...') #1 D:\xampp\htdocs\htm\base\vendor\zendframework\zendframework\library\Zend\XmlRpc\Client.php(245): Zend\Http\Response-&gt;getBody() #2 D:\xampp\htdocs\htm\base\vendor\zendframework\zendframework\library\Zend\XmlRpc\Client.php(318): Zend\XmlRpc\Client-&gt;doRequest(Object(Zend\XmlRpc\Request)) #3 D:\xampp\htdocs\htm\base\module\Zone\src\Zone\Controller\AdminController.php(132): Zend\XmlRpc\Client-&gt;call('ox.agencyZoneSt...', Array) #4 D:\xampp\htdocs\htm\base\vendor\zendframework\zendframework\library\Zend\Mvc\Controller\AbstractActionController.php(90): Zone\Controller\AdminController-&gt;manageAction() #5 [internal function]: Zend\Mvc\Controller\AbstractActionController-&gt;onDispatch(Object(Zend\Mvc\MvcEvent)) #6 D:\xampp\htdocs\htm\base\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(464): call_user_func(Array, Object(Zend\Mvc\MvcEvent)) #7 D:\xampp\htdocs\htm\base\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(208): Zend\EventManager\EventManager-&gt;triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure)) #8 D:\xampp\htdocs\htm\base\vendor\zendframework\zendframework\library\Zend\Mvc\Controller\AbstractController.php(107): Zend\EventManager\EventManager-&gt;trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure)) #9 D:\xampp\htdocs\htm\base\vendor\zendframework\zendframework\library\Zend\Mvc\DispatchListener.php(113): Zend\Mvc\Controller\AbstractController-&gt;dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response)) #10 [internal function]: Zend\Mvc\DispatchListener-&gt;onDispatch(Object(Zend\Mvc\MvcEvent)) #11 D:\xampp\htdocs\htm\base\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(464): call_user_func(Array, Object(Zend\Mvc\MvcEvent)) #12 D:\xampp\htdocs\htm\base\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(208): Zend\EventManager\EventManager-&gt;triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure)) #13 D:\xampp\htdocs\htm\base\vendor\zendframework\zendframework\library\Zend\Mvc\Application.php(297): Zend\EventManager\EventManager-&gt;trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure)) #14 D:\xampp\htdocs\htm\base\public\index.php(15): Zend\Mvc\Application-&gt;run() #15 {main} </code></pre> <p>And i detect it's come from my <code>Zend\XMLRpc\Client</code> call</p> <pre><code>$httpClient = new \Zend\Http\Client(); $oxClient = new \Zend\XmlRpc\Client('http://xxx.com/www/api/v2/xmlrpc/',$httpClient); $oxSession = $this-&gt;oxClient-&gt;call('ox.logon',$oxLogin); $zone_list = $this-&gt;oxClient-&gt;call('ox.agencyZoneStatistics',array($oxSession,$agency_id)); </code></pre> <p>I call to OpenX API system. At the first call with <code>logon</code> was success but the second fail ??! I think my problem point in <code>decodeChunkedBody</code> function at <code>Zend\Http\Response.php</code>. It's cannt understand chunked response from OpenX</p> <pre><code>protected function decodeChunkedBody($body) { $decBody = ''; while (trim($body)) { if (! preg_match("/^([\da-fA-F]+)[^\r\n]*\r\n/sm", $body, $m)) { throw new Exception\RuntimeException( "Error parsing body - doesn't seem to be a chunked message" ); } $length = hexdec(trim($m[1])); $cut = strlen($m[0]); $decBody .= substr($body, $cut, $length); $body = substr($body, $cut + $length + 2); } return $decBody; } </code></pre> <p>I stuck here. The first old lib (2.0.4) work well , i upgrade it because the requirement for using zfcuser,zfcbase. But the new lib (2.0.6) got this error in second call ( and any except <code>logon</code> method ). </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload