Wednesday, July 30, 2008

Bug: Zend Framework 1.5.1-1.5.3 Zend_Rest_Client

When contacting the Rest Server via the Zend_Rest_Client's get() method, you will get errors when passing a string argument that's roughly 500+ characters long.

The code:
$client = new Zend_Rest_Client($restServer);
// $arg1 has 1000 length
$result = $client->MyMethod($arg1, $arg2)->get();

would yield:
string '

Invalid Method Call to MyMethod. Requires 2, 1 given.

failed
'
(length=242)

You can get the data sent back from contacting the rest server by dumping the variable $data before line 43 in Zend/Rest/Client/Result.php (ZF 1.5.3):
var_dump($data);

Fix:
Use the method post() instead of get().


0 Comments:

Post a Comment

<< Home