Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Create product API call results in: Zend_XmlRpc_Client_FaultException with message ‘Invalid date.’
 
drkstr
Jr. Member
 
Total Posts:  8
Joined:  2010-07-10
 

Hello All,

I am doing some maintenance work for a magento plugin I created a couple years ago. Everything worked beautifully after migrating to the new server, except for a piece of code that creates a new product record. When I attempt to make this API call, I get an error message back from Zend claiming an “Invalid date.” So far, none of the custom code has been modified, but the Magento/Zend frameworks on the new server might be slightly newer.

Here is a small test that produces the error:

<?php

//configure a few settings and bootstrap Zend
require_once($_SERVER['DOCUMENT_ROOT'].'/php/lib/Settings.php');
require_once(
$_SERVER['DOCUMENT_ROOT'].'/zend_bootstrap.php');


print 
"<p>**Beginning Tests</p>\n";

//Create API Connection
$httpClient = new Zend_Http_Client();
$httpClient->setConfig(array('timeout' => '120'));
$apiClient = new Zend_XmlRpc_Client(API_GATEWAY$httpClient);
$apiToken $apiClient->call('login', array(API_USERAPI_KEY));

//Set up API call
$sku "T0001";
$product_type "simple";
$attribute_set_id Settings::get("BOARD_ATTRIBUE_SET_ID");

$memento = array();
$memento['name'"Test";
$memento['price'350.00;
$memento['weight'10;

//initiate call
$result $apiClient->call(
    
'call'
    array(
        
$apiToken,
        
'catalog_product.create',
        array(
$product_type$attribute_set_id$sku$memento)
    )
);


//Close API Connection
$apiClient->call('endSession', array($apiToken));

print 
"<p>Result: $result</p>\n";
print 
"<p>**Completed Tests</p>\n";
?>

Result:

**Beginning Tests

Fatal error: Uncaught exception ‘Zend_XmlRpc_Client_FaultException’ with message ‘Invalid date.’ in /var/www/ZendFramework/library/Zend/XmlRpc/Client.php:370 Stack trace: #0 /var/www/createproduct_test.php(33): Zend_XmlRpc_Client->call(’call’, Array) #1 {main} thrown in /var/www/ZendFramework/library/Zend/XmlRpc/Client.php on line 370

It only does this when creating new products. I can load or modify existing products just fine.

Any ideas what may be causing this?

Magento ver. 1.4.2.0

Many thanks for your time!

~Aaron

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top