Magento SOAP API - Invalid XML fault(reindex())



我实现了重新索引API调用。对于类别索引,它按预期工作。对于产品索引(大约需要 3 分钟来处理(,将启动一个进程,但大约 45 秒后,我收到响应"XML无效"。看起来,存在执行时间问题。我确实将参数max_execution_time更改为 600(秒(。我启用了日志记录,但没有收到异常或错误。在索引管理 GUI 中,我看到重新索引过程在返回响应(无效 XML(后 2 分钟启动并成功完成(总重新索引时间约为 3 分钟(。

API 的代码看起来不错,因为我可以更新除产品价格和产品平面数据之外的所有索引。

知道吗?

使用Wireshark:请求:POST/index.php/api/v2_soap/index/HTTP/1.1用户代理:Mozilla/4.0(兼容;微星6.0;MS 网络服务客户端协议 2.0.50727.3053(VsDebuggerCausalityData: uIDPo6o2uSDL0oVKpqKJjDrFPsEAAAAAJt2oK8A51UOeAJsKkziyy/q2t81fNIxMnAvF+VaT7jIACQAA内容类型:文本/XML;字符集=UTF-8肥皂:Mage_Api_Model_Server_V2_HandlerAction"主机:XXXXXXXXXXXX(出于安全原因隐藏(内容长度:609预期:100-续HTTP/1.1 100 继续

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:tns="urn:Magento" xmlns:types="urn:Magento/encodedTypes" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:iwCoreIndexingReindexById>
  <sessionId xsi:type="xsd:string">835cfa019572c1a893b3799eecbc6903</sessionId>
  <indexId xsi:type="xsd:int">4</indexId>
</tns:iwCoreIndexingReindexById>
</soap:Body>
</soap:Envelope>

响应(39秒后!HTTP/1.1 500 内部服务错误日期:2012 年 5 月 18 日星期五 20:50:22 GMT服务器:阿帕奇X-Powered-By: PHP/5.2.17内容长度:269连接:关闭内容类型:文本/XML;字符集=UTF-8

<?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>Sender</faultcode>
    <faultstring>Invalid XML</faultstring>
  </SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

索引的状态正在处理中。因此,调用调用并且操作也在进行中。Api.php看起来像(执行此代码并且不记录异常(:

public function indexingReindexById( $indexId ){
$process = Mage::getModel('index/process')->load($indexId);
try{
  $process->reindexAll();
} catch(exception $e){
  Mage::Log($e->getMessage());
  return false;
}
return true;
}

更改提供程序确实可以完成。所以这是一个服务器问题

最新更新