cancel
Showing results for 
Search instead for 
Did you mean: 

Magento SOAP API - internal server error

Magento SOAP API - internal server error

Hi Everyone,

 

I am trying to hook up Magento and TradeGecko but are getting an Internal Server Error.  I can grab the wsdl via http://domain/api/?wsdl using a browser.   Any suggestions for what might be my issue?  TradeGecko support gave me a simple php script to run but it's also throwing an internal server error:

 

Fatal error: Uncaught SoapFault exception: [HTTP] Internal Server Error in C:\inetpub\wwwroot\hih\tgscript2.php:10 Stack trace: #0 [internal function]: SoapClient->__doRequest('__call('login', Array) #2 C:\inetpub\wwwroot\hih\tgscript2.php(10): SoapClient->login('tradegecko...', 'abcdefgh') #3 {main} thrown in C:\inetpub\wwwroot\hih\tgscript2.php on line 10

 

<?php
$host = "ourdomain"; //our online shop url
$client = new SoapClient("http://".$host."/api/soap/?wsdl"); //soap handle
$apiuser= "user"; //webservice user login
$apikey = "pw"; //webservice user pass
$action = "coremagento.info"; //an action to call later
try {
$sess_id= $client->login($apiuser, $apikey); //we do login
$client->call($sess_id, $action);
}
catch (SoapFault $e) { //while an error has occured
echo "==> Code: ".$e->faultcode;
echo "\n==> Error: ".$e->__toString(); //we print this
exit();
}
?>

 

thanks

Andrew