2012-09-28 56 views
0

我想從Magja項目創建一個客戶,並且我得到的AxisFault是100「需要客戶電子郵件。」 。我正在從1.7文檔中傳遞正確的最小參數。長故事,我的錯誤代碼是說我不包括我的電子郵件,但它顯然存在(沒有把敏感信息放在所以...所以你只需要相信我:))。有任何想法嗎?客戶的SOAP Magento錯誤

Stack 
org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving component type of array. 

//soapclient line 208 
result = sender.sendReceive(method) -> method variable 

<mag:call xmlns:mag="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-XML="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <sessionId>9be685563680f52c1ab5375bec545dfe</sessionId> 
    <resourcePath>customer.create</resourcePath> 
    <args SOAP-ENC:arrayType="xsd:ur-type[1]" xsi:type="SOAP-ENC:Array"> 
     <item SOAP-ENC:arrayType="xsd:ur-type[1]" xsi:type="SOAP-ENC:Array"> 
      <item xsi:type="SOAP-XML:Map"> 
       <item> 
        <key xsi:type="xsd:string">email</key> 
        <value xsi:type="xsd:string">MY EMAIL</value> 
       </item> 
       <item> 
        <key xsi:type="xsd:string">password_hash</key> 
        <value xsi:type="xsd:string">4cb9c8a8048fd02294477fcb1a41191a</value> 
       </item> 
       <item> 
        <key xsi:type="xsd:string">group_id</key> 
        <value xsi:type="xsd:int">1</value> 
       </item> 
       <item> 
        <key xsi:type="xsd:string">store_id</key> 
        <value xsi:type="xsd:int">1</value> 
       </item> 
       <item> 
        <key xsi:type="xsd:string">lastname</key> 
        <value xsi:type="xsd:string">LName</value> 
       </item> 
       <item> 
        <key xsi:type="xsd:string">firstname</key> 
        <value xsi:type="xsd:string">Fname</value> 
       </item> 
       <item> 
        <key xsi:type="xsd:string">website_id</key> 
        <value xsi:type="xsd:int">1</value> 
       </item> 
      </item> 
     </item> 
    </args> 
</mag:call> 

//magentosoapclient line 215 
throw axisFault (axisfault -> message) 
<?xml version='1.0' encoding='utf-8'?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> 
    <SOAP-ENV:Body> 
     <SOAP-ENV:Fault> 
      <faultcode>100</faultcode> 
      <faultstring>Customer email is required</faultstring> 
     </SOAP-ENV:Fault> 
    </SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

回答

1

您需要跟蹤/記錄Magento事物結束的數據。不知怎的,電子郵件在這個過程中迷失了和/或消失了。這就是所謂的客戶創造的PHP代碼是

#File: app/code/core/Mage/Customer/Model/Customer/Api.php 
public function create($customerData) 
{ 
    $customerData = $this->_prepareData($customerData); 
    try { 
     $customer = Mage::getModel('customer/customer') 
      ->setData($customerData) 
      ->save(); 
    } catch (Mage_Core_Exception $e) { 
     $this->_fault('data_invalid', $e->getMessage()); 
    } 
    return $customer->getId(); 
} 

,併發送特定的異常給您的SOAP客戶端是在

#File: app/code/core/Mage/Customer/Model/Resource/Customer.php 
protected function _beforeSave(Varien_Object $customer) 
{ 
    parent::_beforeSave($customer); 

    if (!$customer->getEmail()) { 
     throw Mage::exception('Mage_Customer', Mage::helper('customer')->__('Customer email is required')); 
    } 

有一些關於你的客戶的呼叫和/或特定的Magento你正在使用的系統,使Magento認爲沒有客戶的電子郵件設置。撥打Mage::Log的幾個電話應該讓你走上正確的道路。

+0

嘿@jejernig。我面臨同樣的問題,並且我正在開發api端,並且無法訪問用於調試的magento服務器。正如你已經標記爲已回答的那樣,你能否添加一些關於什麼是錯的以及你如何修復它的信息? –