开发者

Magento catalogProductInfo - access denied for unknown reason

开发者 https://www.devze.com 2023-01-07 14:59 出处:网络
I am getting access denied when asking Magento with following request: <?xml version=\"1.0\" encoding=\"UTF-8\"?>

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</faul开发者_Python百科tcode>
        <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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消