3

I use my localhost response time is 30sec++ (about 2min.i need 30sec)

$client = new SoapClient('http://localhost/magento/api/v2_soap/?wsdl');

// If some stuff requires api authentification,
// then get a session token
$session = $client->login('cats', 'cats@123');
$complexFilter = array(
    'complex_filter' => array(
        array(
            'key' => 'type',
            'value' => array('key' => 'in', 'value' => 'simple,configurable')
        )
    )
);
$result = $client->catalogProductList($session, $complexFilter);

    // Product List here...
    echo '<ul>';

    for($i=0; $i<count($result); $i++){
    echo  '<li style="list-style:decimal;">'.$result[$i]->sku.'<br/>'.$result[$i]->name.'</li>';
    }
    echo '</ul>';
    //var_dump ($result);
  • Make sure the cache for the WSDL is enabled. – Marius May 5 '15 at 12:24
  • Magento cache disabed – matinict May 5 '15 at 14:30
  • 1
    Then enable it. At least the API cache. – Marius May 5 '15 at 14:32
  • If you enable the config cache you might gain a few seconds more. – Marius May 5 '15 at 14:40
2

This might not be practical for everyone, but I switched from SOAP to XML-RPC and my calls went from 30-60 seconds to < 3 seconds. I tried all the suggestions on caching and nothing else worked.

  • Tip: Use PHP's XML-RPC and not Jquery's XML-RPC so that your api username and password are protected and not in plaintext js files. I am also having the same problem where enabling the cache only saved a few seconds, but the SOAP calls were still 30 seconds. Gotta use XML RPC instead of SOAP to make it fast. – Katie Jan 27 '17 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.