我正在开发一个magento脚本,使用API和SOAP wsdl连接从XML文件导入产品.
我想知道故障代码列表,我一直在搜索它几天没有运气,任何人都知道是否有一个我可以找到它?
我需要处理错误代码以避免代码停止而不是仅仅跳过错误并继续导入正确的错误.
目前我刚刚发现故障代码101是"产品不存在".
以下是如何获取您的Magento版本的列表.(我无法想象版本之间会有根本的不同,但是人们永远都不知道对系统做了什么)
找到所有api.xml文件.
$ find app/code/core -name 'api.xml'
app/code/core/Mage/Api/etc/api.xml
app/code/core/Mage/Catalog/etc/api.xml
app/code/core/Mage/CatalogInventory/etc/api.xml
app/code/core/Mage/Checkout/etc/api.xml
app/code/core/Mage/Core/etc/api.xml
app/code/core/Mage/Customer/etc/api.xml
app/code/core/Mage/Directory/etc/api.xml
app/code/core/Mage/Downloadable/etc/api.xml
app/code/core/Mage/GiftMessage/etc/api.xml
app/code/core/Mage/Sales/etc/api.xml
app/code/core/Mage/Tag/etc/api.xml
Run Code Online (Sandbox Code Playgroud)
每个文件都有一个或多个<faults/>节点,其中包含代码和消息.
<!-- File: app/code/core/Mage/CatalogInventory/etc/api.xml -->
<faults module="cataloginventory">
<not_exists>
<code>101</code>
<message>Product not exists.</message>
</not_exists>
<not_updated>
<code>102</code>
<message>Product inventory not updated. Details in error message.</message>
</not_updated>
</faults>
Run Code Online (Sandbox Code Playgroud)
值得一提的是,数字代码并不是唯一的.每个"肥皂对象"(不确定该叫什么)都定义了它自己的.
<!-- File: app/code/core/Mage/Sales/etc/api.xml -->
<faults module="sales">
<not_exists>
<code>100</code>
<message>Requested order not exists.</message>
</not_exists>
<filters_invalid>
<code>101</code>
<message>Invalid filters given. Details in error message.</message>
</filters_invalid>
Run Code Online (Sandbox Code Playgroud)
祝好运!
| 归档时间: |
|
| 查看次数: |
3923 次 |
| 最近记录: |