简体   繁体   中英

Magento API error: Invalid data given. Details in error message. - Where is this “error message”?

I was trying to create a new product but some weird problem happened and it simply gave me this error:

Invalid data given. Details in error message.

Which was generated by $e -> getMessage() from this snippet:

try {
    $result = $proxy -> call($sessionId, $api, $parameters);
    return $result;
} catch (SoapFault $e) {
    echo '<p style="color:red;">'.$e -> getMessage().'</p>';
    return false;
}

So where is this "error message"? Thanks!

Highly recommend TechColins approach for logging all API calls and responses:

Magento API performance issues when doing bulk product updates

http://techcolin.net/2011/11/a-php-proxy-script-for-logging-magento-api-soap-calls/

It will enable you to see exactly what's getting passed to the API and the error magento responds with.

Might seem a bit of extra overhead if you're just looking for a quick fix right now, but will be of massive benefit for diagnosing future issues.

All Magento log files and reports are placed in the var/ sub directories, these are :

{Mage_path}/var/log
{Mage_path}/var/report

Also check if the configuration is set to output messages in log files ( in System / Configuration / Developer ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM