Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4607

How do I correctly call Magento SOAP API with Ruby Savon for Category Product Links?

$
0
0

I am trying to call the catalog_product_link.list API method using Savon. However, I keep receiving the error Error cannot find parameter.

Here is what I am using, though I have tried several variations of the call and still cannot get it to go through correctly:

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 workclient.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'})}

Is there a different way to format to get this to work?

UPDATE: If I try removing the type parameter, it gives the error Given invalid link type, so it appears it does not like something about multiple parameters.

response = client.call(:call){message(:session => session, :method => 'catalog_product_link.list', :product => '166')}

Viewing all articles
Browse latest Browse all 4607

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>