Note that there are some explanatory texts on larger screens.

plurals
  1. POMagento 1.7.0.1 Override Mage_Api_Model_Server_WSI_Handler
    text
    copied!<p>I am getting this error when I try to login using API (SoapUI 4.5):</p> <p><br /> <b>Fatal error</b>: SoapFault::SoapFault() [&lt;a href='soapfault.soapfault'&gt;soapfault.soapfault&lt;/a&gt;]: Invalid parameters. Invalid fault code. in <b>/home/profi506/public_html/magento/v1701/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php</b> on line <b>172</b><br /></p> <p>Because I tried to override the function "<strong>__call</strong>" in class "<strong>Mage_Api_Model_Server_WSI_Handler</strong>".</p> <p>These are my files:</p> <h2><strong>app/etc/modules/MyCompany_Api.xml</strong></h2> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;MyCompany_Api&gt; &lt;active&gt;true&lt;/active&gt; &lt;codePool&gt;local&lt;/codePool&gt; &lt;/MyCompany_Api&gt; &lt;/modules&gt; &lt;/config&gt; </code></pre> <h2><strong>app/code/local/MyCompany/Api/etc/config.xml</strong></h2> <pre><code>&lt;config&gt; &lt;modules&gt; &lt;MyCompany_Api&gt; &lt;version&gt;0.0.1&lt;/version&gt; &lt;/MyCompany_Api&gt; &lt;/modules&gt; &lt;global&gt; &lt;models&gt; &lt;api&gt; &lt;rewrite&gt; &lt;server_wsi_handler&gt;MyCompany_Api_Model_Server_WSI_Handler&lt;/server_wsi_handler&gt; &lt;/rewrite&gt; &lt;/api&gt; &lt;/models&gt; &lt;/global&gt; &lt;/config&gt; </code></pre> <h2><strong>app/code/local/MyCompany/Api/Model/Server/Wsi/Handler.php</strong></h2> <pre><code>&lt;?php /** * Webservices server handler WSI * * @category MyCompany * @package MyCompany_Api * @author MyCompany &lt;***&gt; */ 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 ... } } ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload