Java Magento catalogProductInfo-由于未知原因拒绝访问

Java Magento catalogProductInfo-由于未知原因拒绝访问,java,php,soap,magento,axis,Java,Php,Soap,Magento,Axis,在向Magento提出以下请求时,我的访问被拒绝: <?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/XML

在向Magento提出以下请求时,我的访问被拒绝:

<?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>

XXXXXXXXXXXXX
119
以下是答复:

<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>

2.
访问被拒绝。

会话id正确,我可以执行其他请求,但catalogProductInfo失败。我正在使用Java和Axis 1.4访问Magento。

实际原因是API是在没有任何产品访问权限的情况下使用角色访问的


您应该为访问此API的用户角色启用产品访问。

用户角色也需要登录。这个答案帮助我摆脱了困境。谢谢