ZF-8074: Problem when calling a webservice method with a Zend_XmlRpc_Value_DateTime object as parameter

Issue Type: Bug Created: 2009-10-14T15:58:51.000+0000 Last Updated: 2009-12-09T19:58:09.000+0000 Status: Resolved Fix version(s): - 1.9.7 (11/Jan/10)

Reporter: Fabio Napoleoni (fabio) Assignee: Lars Strojny (lars) Tags: - Zend_XmlRpc_Client

Related issues: Attachments:


I have an object esposed as web service using Zend_XmlRpc_Server whose signature is:

<pre class="highlight">
     * Return the spots for the date and edition provided
     * @param dateTime.iso8601 $day 
     * @param string $edition two letter iso code for edition
     * @param string $type type of ads to be retrieved
     * @return boolean|array spots array or false if there is any error
    public function dailyAds($day, $edition, $type);

When using this webservice I can call it in the following way:

<pre class="highlight">
$client = new Zend_XmlRpc_Client($endpoint);
$date = new Zend_XmlRpc_Value_DateTime(time());
$edition = 'foo';
$type = 'bar';
$client->getProxy('ads')->dailyAds($date, $edition, $type);

as stated here:…

However when I execute the client code I obtain:

<pre class="highlight">
Warning: strtotime() expects parameter 1 to be string, object given in /var/ZendFramework-1.9.3/library/Zend/XmlRpc/Value/DateTime.php on line 55

Catchable fatal error: Object of class Zend_XmlRpc_Value_DateTime could not be converted to string in /var/ZendFramework-1.9.3/library/Zend/XmlRpc/Value/DateTime.php on line 57

If I call the webservice with Zend_Date::now()->get(Zend_Date::DATE_ISO8601) or directly with the timestamp the webservice works fine.

The error is triggered by Zend/XmlRpc/Value.php by the method getXmlRpcValue at line 151, which is called by Zend/XmlRpc/Client.php at line 344.

In previous versions of Zend Framework this code works fine (the old version of my app runs on 1.5.2)


Posted by Fabio Napoleoni (fabio) on 2009-10-16T20:06:28.000+0000

Edit: this behaviour doesn't happen on my development platform with this specs: OS: Mac OSX 10.6 Webserver: MAMP 1.7.2 php: PHP 5.2.6 (cli) (built: Jul 24 2008 08:32:16) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies with Zend Debugger v5.2.15, Copyright (c) 1999-2008, by Zend Technologies ZF 1.9.3PL1

However it does happen on production host with following specs: OS: Debian Stable Webserver: apache 2.2.9-10+lenny4 PHP: PHP 5.2.6-1+lenny3 with Suhosin-Patch (cli) (built: Apr 26 2009 22:16:23) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies ZF: 1.9.3PL1

Posted by Fabio Napoleoni (fabio) on 2009-10-16T20:28:22.000+0000

Please ignore my previous comment, it doesn't depend on platform, it depends if system lookup is activated, if I add this line:

<pre class="highlight">

to my code it works on both platforms. Is it normal?

Posted by Lars Strojny (lars) on 2009-12-09T19:58:09.000+0000

Thanks for your bug report. The issue has been fixed in trunk (r19564) and standard-release-1.9 (r19565).

Have you found an issue?

See the Overview section for more details.


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

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