9

enter image description here

We are developing an android app for a magento site. We have to pass SOAP API from magento to android to get session id.

We created SOAP web user and roles in magento admin panel by following this link:

https://www.yireo.com/tutorials/magebridge/administration/596-step-by-step-create-a-magento-api-user

When we try to connect from android to magento, we are getting error. This is the link we are using:

http://videomergerapp.com/index.php/api/v2_soap/

  • 1
    Hello - I cannot see the error at the link you provided; it says down for maintenance. – Garet Claborn Sep 2 '15 at 14:13
  • hi, sorry that site is under maintance, please check the updated question. – Baby in Magento Sep 2 '15 at 14:21
  • 1
    Did you try the steps from my previous question? This does look like the same error I got which was caused by the firewall and NAT settings for my server. – Garet Claborn Sep 3 '15 at 15:15
  • 1
    When magento is trying to get some resources, it makes more SOAP requests to itself but instead of using localhost like it should it will try to go all the way to the external IP and hostname. In my case I had to open the firewall to loopbacks and add my domain and external IP to the hosts file – Garet Claborn Sep 3 '15 at 15:16
  • okay @GaretClaborn i will check with server team. – Baby in Magento Sep 4 '15 at 5:23
5

SOAP server needs to be initialized with WSDL to understand how to process incoming requests (it basically loads WSDL from the specified URL in case of Magento). This happens in \Mage_Api_Model_Server_Adapter_Soap::_instantiateServer():

$this->_soap = new Zend_Soap_Server(
    $this->getWsdlUrl(array("wsdl" => 1)),
    array('encoding' => $apiConfigCharset)
);

Note that getWsdlUrl() constructs WSDL URL based on your Magento instance base URL. It means that if your Magento store is not accessible from the the host where it is deployed, SOAP server will not be able to load WSDL during initialization. As a result you would encounter such error when trying to perform requests to Magento SOAP API.

  • And how we can fix this? – Alexandros Jan 26 '16 at 14:32
  • Add Magento instance host to /etc/hosts on the server. – Alex Paliarush Jan 26 '16 at 14:56
  • I did add my IP XXX.XXX.XXX.XXX www.example.com but i still get the same thing. I also tried to curp and ping the full domain and they work :( – Alexandros Jan 26 '16 at 14:57
  • Can you load WSDL while on that server? – Alex Paliarush Jan 26 '16 at 15:00
  • 1
    Not sure than, try to debug somewhere around \Mage_Api_Model_Server_Adapter_Soap::_instantiateServer() – Alex Paliarush Jan 26 '16 at 15:04
1

I was experiencing the same issue. I did install the orocrm bridge which needs to access the soap api, followed the given steps to configure a soap role and a user and then I tried to connect: 💥 Parameters are not valid!

After digging in the logs, I did notice this error:

[2017-07-03 16:57:46] app.CRITICAL: MageCheck 
error: 0:  [message]           
SOAP-ERROR: Parsing WSDL: Couldn't load from 
'https://my.magento.store/index.php/api/v2_soap/index/?wsdl=1' : 
failed to load external entity 
"https://my.magento.store/index.php/api/v2_soap/index/?wsdl=1"

[request]
<?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <SOAP-ENV:Body>
            <ns1:login>
                <username xsi:type="xsd:string">orocrm</username>
                <apiKey xsi:type="xsd:string">***</apiKey>
            </ns1:login>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

[response]
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
        <SOAP-ENV:Fault>
            <faultcode>WSDL</faultcode>
            <faultstring>
SOAP-ERROR: Parsing WSDL: Couldn't load from  'https://my.magento.store/index.php/api/v2_soap/index/?wsdl=1' : 
failed to load external entity "https://my.magento.store/index.php/api/v2_soap/index/?wsdl=1"
            </faultstring>
        </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

[code]              500   [] []

I figured out why I experienced this issue. Actually, this wasn't related to orocrm but to magento. That was a firewall issue. Actually, I did add correctly the rules to allow the crm server to attack the magento api but this one needs to reach out itself ! So after some headaches, I just add a rule on the magento server's firewall to allow itself (the magento server) to reach its own api (kind of external lookup)...

Anyway, I hope this will save some hours to someone

  • 1
    thanks for answer, very difficult to get solution for these soap related questions, i know the pain...... – Baby in Magento Jul 5 '17 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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