gpt4 book ai didi

xml - magento soap api v2 catalogProductInfo "product not exists"错误

转载 作者:可可西里 更新时间:2023-11-01 16:49:57 26 4
gpt4 key购买 nike

尝试使用 v2 API 从 magento 获取产品信息时,我遇到了有点著名的“产品不存在”错误。然而,通常的补救措施似乎都不起作用。例如,我检查了这个线程:magento soap api v2 catalogProductInfo not working

这是我的请求数据:

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:catalogProductInfo>
<sessionId xsi:type="xsd:string">291b294f0a5ec652069dfbd2ba1f42a3</sessionId>
<productId xsi:type="xsd:string">917</productId>
</ns1:catalogProductInfo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

这是我到目前为止尝试过的:

  • 验证并重新生成 session ID
  • 用户的完全访问权限
  • 多个产品 ID(已在管理员和使用 catalogProductList 中验证存在)
  • 同时使用 ID 和 SKU
  • SKU 后面有一个空格
  • 添加 参数
  • 添加 参数
  • 上述的组合

下一步是什么?

最佳答案

我找到了一个解决方案:事实证明 http://www.magentocommerce.com/api/soap/catalog/catalogProduct/catalog_product.info.html 上的 magento 文档是错的。参数“productId”实际上叫做“product”。所以我的工作代码是:

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:catalogProductInfo>
<sessionId xsi:type="xsd:string">291b294f0a5ec652069dfbd2ba1f42a3</sessionId>
<product xsi:type="xsd:string">917</product>
</ns1:catalogProductInfo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

我应该在哪里报告文档中的错误?

关于xml - magento soap api v2 catalogProductInfo "product not exists"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23545647/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com