当我尝试使用API(SoapUI 4.5)登录时出现此错误:
致命错误:SoapFault :: SoapFault()[< a href ='soapfault.soapfault'> soapfault.soapfault< / a>]:参数无效。无效的故障代码。在 /home/profi506/public_html/magento/v1701/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php 172
因为我试图在“ Mage_Api_Model_Server_WSI_Handler ”类中覆盖“ __ call ”功能。
这些是我的文件:
<?xml version="1.0"?>
<config>
<modules>
<MyCompany_Api>
<active>true</active>
<codePool>local</codePool>
</MyCompany_Api>
</modules>
</config>
<config>
<modules>
<MyCompany_Api>
<version>0.0.1</version>
</MyCompany_Api>
</modules>
<global>
<models>
<api>
<rewrite>
<server_wsi_handler>MyCompany_Api_Model_Server_WSI_Handler</server_wsi_handler>
</rewrite>
</api>
</models>
</global>
</config>
<?php
/**
* Webservices server handler WSI
*
* @category MyCompany
* @package MyCompany_Api
* @author MyCompany <***>
*/
class MyCompany_Api_Model_Server_WSI_Handler extends Mage_Api_Model_Server_WSI_Handler
{
protected $_resourceSuffix = '_v2';
/**
* Interceptor for all interfaces
*
* @param string $function
* @param array $args
*/
public function __call ($function, $args)
{
// my custom code is here, before the original code of the function
...
// end of my custom code
...
}
}
?>