$options = array(
        'ssl' => array(
            'verify_peer'=> false,
            'verify_peer_name'  => false,
"trace" => 1,
"exception" => 0
$testClient = new SoapClient($apiHost.'/index.php/api/soap/?wsdl');
$session = $testClient->login($apiUser,$apiPass);

After this request I got the following error

Fatal error: Uncaught SoapFault exception: [HTTP] Internal Server Error

from phpinfo on host server I can see

Soap Client enabled

Soap Server enabled

Also I've tried with v2_soap, the result was the same.

I've compared Magento Core API configurations with another Magento instance where it works and they are same.

What else I check to fix this?

1 Answer 1


Wrap your script in try-catch block and catch \SoapFault exceptions, which are generated by \SoapClient, then you should be able to see exception message:

  try {
      $session = $testClient->login($apiUser, $apiPass);
  } catch (\SoapFault $e) {
      echo $e->getMessage();
  • After wrapping my script into try-catch block I got "Internal Server Error"
    – Gevorg M
    Jan 17, 2016 at 12:10
  • Then you need to check error logs on Magento side Jan 17, 2016 at 17:25
  • I can't find any information about soap request. But I've seen messages connected instance update, and RedsysAPI.php. Could this be a reason for that error?
    – Gevorg M
    Jan 18, 2016 at 11:58
  • Remove all logs on Magento side, execute your script and check newly created logs. 500 error usually means some uncaught exception on server side, so could be anything. Jan 18, 2016 at 15:22
  • Currently problem has solved by the following change in app/code/core/Mage/Api/Model/Server/Adapter/Soap.php ->setHeader('Content-Type','text/xml; charset='.$apiConfigCharset) to ->setHeader('Content-Type','text/xml; charset='.$apiConfigCharset, true) Is there a way to fix it without touching core?
    – Gevorg M
    Jan 19, 2016 at 6:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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