2012-09-28 92 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服务器。正如你已经标记为已回答的那样,你能否添加一些关于什么是错的以及你如何修复它的信息? –