我正在尝试使用Savoncatalog_product_link.list
调用API 方法。但是,我一直收到错误消息。Error cannot find parameter
这是我正在使用的,尽管我已经尝试了几种调用变体,但仍然无法正确通过:
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'})}
有没有不同的格式来让它工作?
更新:如果我尝试删除类型参数,它会给出错误Given invalid link type
,所以看起来它不喜欢关于多个参数的东西。
response = client.call(:call){message(:session => session, :method => 'catalog_product_link.list', :product => '166')}