作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我向 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>
session ID 正确,我可以执行其他请求,但 catalogProductInfo 失败了。我正在使用 Java 和 Axis 1.4 访问 Magento。
最佳答案
实际原因是使用没有任何产品访问权限的角色访问 API。
您应该为访问此 API 的用户角色启用产品访问权限。
关于java - Magento catalogProductInfo - 访问因未知原因被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3236393/
当我向 Magento 提出以下请求时,访问被拒绝: xxxxxxxxxxxxxxx 119
尝试使用 v2 API 从 magento 获取产品信息时,我遇到了有点著名的“产品不存在”错误。然而,通常的补救措施似乎都不起作用。例如,我检查了这个线程:magento soap api v2 c
我是一名优秀的程序员,十分优秀!