Magento API 版本不兼容
我正在使用 Magento 的核心 API 创建目录产品。它在 Magento 版本 1.4.1.1 上运行良好,但相同的代码在 Magento 版本 1.5.0.1 上不起作用。
这是我的代码:
require 'rubygems'
require 'soap/wsdlDriver'
WSDL_URL = 'http://example.code/api/v2_soap/?wsdl=1'
soap = SOAP::WSDLDriverFactory.new(WSDL_URL).create_rpc_driver
session = soap.login('theuser','theuser123')
data = { "name" => "BARRACUDA", "description" => "fill", "short_description" => "fill", "weight" => "12", "status" => 1, "visibility" => 4, "price" => 350.00 , "tax_class_id" => "2", "qty" => 10, "stock_availability" => "0", "category_ids" => [3] }
a1 = soap.call('catalogProductCreate',session,"simple",1,"black: ONT-920-B",data)
我的代码有什么问题,或者 Magento 1.5.0.1 版本中添加了任何新内容吗?
谢谢
I am creating catalog products using Magento's core API. It works fine on Magento version 1.4.1.1, but the same code doesn't work on Magento ver 1.5.0.1.
Here's my code:
require 'rubygems'
require 'soap/wsdlDriver'
WSDL_URL = 'http://example.code/api/v2_soap/?wsdl=1'
soap = SOAP::WSDLDriverFactory.new(WSDL_URL).create_rpc_driver
session = soap.login('theuser','theuser123')
data = { "name" => "BARRACUDA", "description" => "fill", "short_description" => "fill", "weight" => "12", "status" => 1, "visibility" => 4, "price" => 350.00 , "tax_class_id" => "2", "qty" => 10, "stock_availability" => "0", "category_ids" => [3] }
a1 = soap.call('catalogProductCreate',session,"simple",1,"black: ONT-920-B",data)
Is there any problem with my code, or any new things added to Magento version 1.5.0.1?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是日期字段中缺少一个属性
需要提及 magento 1.5 中数据数组中的网站 id。
这对我有用!
The problem is missing one attribute in date field
Need to mention the websites id in the array of data in magento 1.5.
This is works for me!