Question

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/

Was it helpful?

Solution

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.

OTHER TIPS

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

I resolve this issue updating the Auto SSL certificate in a server with CentOS/Apache/WHM/cPanel/Magento 1.9.4 connected to an ERP throug SOAP API v2

In the Auto SSL Logs we have these messages:

PM ERROR TLS Status: Defective ERROR Defect: OPENSSL_VERIFY: The certificate chain failed OpenSSL’s verification (0:10:CERT_HAS_EXPIRED)

*In my case he certificate was not expired, but the issuer had a specific problem: https://forums.cpanel.net/threads/sectigo-issue.673157/

This caused the connection to the api to fail with the following message:

SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://www.example.com/api/v2_soap/?wsdl=1' : failed to load external entity "https://www.example.com/api/v2_soap/?wsdl=1

Updating the certificate solves this issue.

I hope this helps someone else

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top