2011-10-24 10 views
3

APIとSOAP wsdl接続を使用してXMLファイルから製品をインポートするためのmagentoスクリプトを開発しています。SOAP障害コードリスト

フォールトコードのリストを知りたいと思っています。数日間運行していないのですが、何かがあれば誰でも知ることができます。

エラーコードを処理して、エラーをスキップするのではなくコードを停止し、正しいものをインポートし続ける必要があります。

現時点では、障害コード101が「Product not exist」であることがわかりました。

答えて

5

あなたの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 

各ファイルはコードおよびメッセージを含むことになる一つまたは多数<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> 

数値コードは一意ではないと言えるでしょう。それぞれの "石鹸オブジェクト"(これを何と呼ぶべきか不明)は、それ自身を定義します。

<!-- 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> 

幸運!

+0

ありがとう、アラン! :) – Matteo