cancel
Showing results for 
Search instead for 
Did you mean: 

I get this error while I soap login in Magento1.9

I get this error while I soap login in Magento1.9

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://bsho2u.com/index.php/api/soap/?wsdl' : failed to load external entity "http://bsho2u.com/index.php/api/soap/?wsdl" in /home/bshop2u/public_html/apirest/soap_login.php:32
I get this error while I soap login in Magento1.9

3 REPLIES

Re: I get this error while I soap login in Magento1.9

Hi @Swati2707,

 

Can you sahre the code you're using to connect to the endpoint?

Have you firewall blocking ports?

Is the domain/store reachable from the server/client that tries to connect to the endpoint?

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: I get this error while I soap login in Magento1.9

Hello @Damian Culotta,

 

Thank you for replying.

 

<?php


error_reporting(E_ALL);
ini_set("display_errors", 1);

$result=array();

$config=array();
$config["hostname"] = "bsho2u.com";
$config["login"] = "soap_admin";
$config["password"] = "program010101";



$proxy = new SoapClient('http://'.$config["hostname"].'/api/v2_soap/?wsdl', array('trace'=>1));


// $proxy = new SoapClient('http://'.$config["hostname"].'/index.php/api/soap/?wsdl', array('trace'=>1));



$sessionId = $proxy->login($config["login"], $config["password"]);

$result['session_id'] = $sessionId;
$shoppingCartIncrementId = $proxy->shoppingCartCreate($sessionId, '1');
$result['cart_id'] = $shoppingCartIncrementId;
if (!empty($sessionId) && !empty($shoppingCartIncrementId)) {

$json = array("error" => false, "message" => $result);

} else {

$json = array("error" => false, "message" => "Soap Error!");

}

/ Output header /
header('Content-type: application/json, charset=UTF-8');
echo json_encode($json);

?>
http://'.$config["hostname"].'/api/v2_soap/?wsdl', array('trace'=>1)
this is the endpoint

 

No, I dont think firewall is blocking ports.

 

How to I check for reachability of the domain/store from the server/client that tries to connect to the endpoint.

Re: I get this error while I soap login in Magento1.9

Hi @Swati2707,

 

Your code works (I've tested with a vanilla installation to be sure).

Did you found some information on your Magento logs? Is the PHP Soap extension installed on your server?

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"