Magento CatalogProductInfo - 访问因未知原因被拒绝
当向 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>
这是响应:
<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>
会话 id 是正确的,我可以执行其他请求,但 CatalogProductInfo 只是失败。我正在使用 Java 和 Axis 1.4 访问 Magento。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际原因是使用没有任何产品访问权限的角色访问API。
您应该为访问此 API 的用户角色启用产品访问权限。
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.