3
我正在尝试使用来调用catalog_product_link.list
API方法。但是,我一直收到错误Error cannot find parameter
。如何使用Ruby Savon为类别产品链接正确调用Magento SOAP API?
这里是我使用的是什么,虽然我已经试过通话几种变化,但仍无法得到它要经过正确:
client = Savon.client(wsdl: 'http://localhost/index.php/api/soap/?wsdl')
response = client.call(:login){message(username: 'user', apiKey: 'key')}
session = response.body[:login_response][:login_return]
#These all do not work
client.call(:call){message(:session => session, :method => 'catalog_product_link.list', :type => 'up_sell', :productId => '166')}
client.call(:call){message(:session => session, :method => 'catalog_product_link.list', :type => 'up_sell', :product => '166')}
client.call(:call){message(:sessionId => session, :resourcePath => 'catalog_product_link.list', :args => {:type => 'up_sell', :product => '166'})}
client.call(:call){message(:sessionId => session, :resourcePath => 'catalog_product_link.list', :args => {:type => 'up_sell', :productId => '166'})}
client.call(:call){message(:sessionId => session, :resourcePath => 'catalog_product_link.list', :arguments => {:type => 'up_sell', :product => '166'})}
是否有不同的方式来格式化来得到这个工作?
UPDATE:如果我尝试删除类型参数,它会给出错误Given invalid link type
,因此它看起来并不喜欢关于多个参数的内容。
response = client.call(:call){message(:session => session, :method => 'catalog_product_link.list', :product => '166')}
参见http://stackoverflow.com/questions/7634928/adding-a-product-using-savon-to-connect-to-magento-api –
@RachelGallen,是的,我看到了,虽然没有太大的帮助,但作为它不适用于这种情况。 –