Ruby で製品をリストするためのコードが機能していますが、製品を追加するのに苦労しています。これが私のコードです。http://www.polyvision のコードに基づいて、HTTP/SOAP リクエストに savon gem を使用しています。 org/2011/10/02/using-magento-soap-api-with-ruby-and-savon/
# Insert some products ...
newproductdata = [
["name" , “test product"],
["websites" , [1]],
["short_description" , ‘short description’],
["description" , ‘description’],
["status" , 1],
["weight" , 0],
["tax_class_id" , 1],
["categories" , [3]],
["price" , 12.05]
]
begin
response = client.request :call do
soap.body = {:session => session, :method => “product.create”, :arguments => ["simple", 1, “testsku1”, newproductdata]}
end
rescue Savon::SOAP::Fault => fault
puts “*****#{fault.to_s}*****”
end
問題は、おそらく正しく名前を付ける必要がある :arguments の受け渡しだと思います。このコードはエラーを生成します。
(SOAP-ENV:Client) Error cannot find parameter