Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Magento SOAP API - error calling http://your.domain/api/v2_soap?wsdl
 
alduro
Jr. Member
 
Total Posts:  24
Joined:  2008-11-30
Capital Federal
 

Hi,
I’m trying to call Web service API but I’m getting the following error:

<SOAP-ENV:Envelope>
−
<SOAP-ENV:Body>
−
<SOAP-ENV:Fault>
<faultcode>WSDL</faultcode>
−
<faultstring>
SOAP-ERROR: Parsing Schema: unexpected <import> in schema
</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

URL:
http://magento.com/ecp/api/v2_soap?wsdl

Ubuntu 9.04, PHP 5.2.6, SoapClient

and I patched my Magento 1.3.1 installation with this:
http://www.magentocommerce.com/blog/comments/soap-webservice-api-wsdl-issue-for-php-version-526/

The sample Code:

<?php

$apiuser = 'sampleuser';
$apikey = 'sampleuser';
$wsdl = 'magento-wsdl.xml';
#$wsdl = 'http://magento.com/ecp/api/?wsdl';

try {
$client = new SoapClient($wsdl, array('trace' => 1));
#print_r($client->__getFunctions());
#$client->__setLocation('http://magento.com/ecp/index.php/api/soap/index/');
#print_r($client);
$session = $client->login($apiuser, $apikey);
$results = $client->call($session, 'customer.list');
print_r($results);
exit();
}
catch (Exception $e) {
print_r($e."\n\n");
exit();
}

?>

Error:
:!/usr/bin/php calling_webservice.php
SoapFault exception: [HTTP] Error Fetching http headers in /home/aldo/Desarrollo/php/test/calling_webservice.php:14
Stack trace:
#0 [internal function]: SoapClient->__doRequest(’<?xml version=”...’, ‘http://magento....’, ‘urn:Mage_Api_Mo...’, 1, 0)
#1 [internal function]: SoapClient->__call(’login’, Array)
#2 /home/aldo/Desarrollo/php/test/calling_webservice.php(14): SoapClient->login(’sampleuser’, ‘sampleuser’)
#3 {main}

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top