javaphpmagentoaxismagento-soap-api

Magento catalogProductInfo - access denied for unknown reason


I am getting access denied when asking Magento with following request:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <ns1:catalogProductInfo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                xmlns:ns1="urn:Magento">
            <sessionId xsi:type="xsd:string">xxxxxxxxxxxxxxx</sessionId>
            <productId xsi:type="xsd:string">119</productId>
            <storeView xsi:type="xsd:string" xsi:nil="true"/>
            <attributes xsi:type="ns1:catalogProductRequestAttributes" xsi:nil="true"/>
        </ns1:catalogProductInfo>
    </soapenv:Body>
</soapenv:Envelope>

Here is the response:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
    <SOAP-ENV:Fault>
        <faultcode>2</faultcode>
        <faultstring>Access denied.</faultstring>
    </SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Session id is correct and I can do other request but catalogProductInfo just fails. I am using Java and Axis 1.4 to access Magento.


Solution

  • The actual reason was that API was accessed using a role without any products access permission.

    You should enable products access for user role with which you access this API.