1
votes

When I go to [url]/api (where [url] is the url of my Magento), I get this response:

<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>WSDL</faultcode>
<faultstring>SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.example.com/magento/1.7/index.php/api/index/index/?wsdl=1' : Couldn't find end of Start Tag part line 56
</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The correct response should be:

<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>Sender</faultcode>
<faultstring>Invalid XML</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

What gives ?

2
What do you mean what gives? What makes you think the response should be the later? - Alan Storm
Well Alan, two things make me think that the response should be the later. If you load the base Mage_Api URL magento.example.com/api directly in a browser, you’ll get a response something like this <SOAP-ENV:Envelope xmlns:SOAP-ENV="schemas.xmlsoap.org/soap/envelope"> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>Sender</faultcode> <faultstring>Invalid XML</faultstring> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> which looks a bit like a SOAP response. - user1392439
With the exception of the first sentence, my previous post contains a quotation of your 4th article about the Magento API. This was the first thing. The second thing is: On the "official" Magento demo site, appending "api" to the home page url gives the same response "Sender/Invalid XML" - user1392439
My installation is a basic install, with the demo data loaded. Appending "api/soap/index?wsdl" to the url displays the WSDL XML. My question is: why do I receive an incorrect response ? - user1392439
What happens when you attempt to load the WSDL yourself from the mentioned URL? example.com/magento/1.7/index.php/api/index/index/?wsdl=1 - Alan Storm

2 Answers

1
votes

I'm late but hope my reply will be useful for someone in future.

I had exactly the same problem. I had installed Zend Server (PHP 5.3.9) and was getting the same error. I searched a lot and applied all available solutions but fails.... Finally, i installed wamp and then run 'Soap Client' script over there and it runs successfully.

Then i reached on this point that Zend Server (PHP 5.3.9) has some default bug in 'Soap Client' Script. I uninstalled Zend Server (PHP 5.3.9) and installed Zend Server (PHP 5.4.11) and runs 'Soap Client' script over there. This time it runs successfully.

Conclusion: Please use latest PHP version (Zend Server) or (Wamp Server) as, there is default 'Soap Client' bug in some PHP versions, one i mentioned above.

Thanks, Kashif

-1
votes

The answer is: it comes from a PHP bug. The truth is in a post by floriancarstens here: Magento Forum