Alessandro Vermeulen
Alessandro Vermeulen

Reputation: 1331

Nil value params when using wash_out in Rails 3.1

I am following the guide on the page of Wash_Out. And I'm getting the following error when I call one of the SOAP methods:

NoMethodError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]): 

The API controller looks like this

class ApiController < ApplicationController

  include WashOut::SOAP

  soap_action "integer_to_string",
              :args   => :integer,
              :return => :string
  def integer_to_string
    render :soap => params[:value].to_s
  end

  soap_action "concat",
              :args   => { :a => :string, :b => :string },
              :return => :string
  def concat
    render :soap => (params[:a] + params[:b])
  end
end

The request to the WSDL runs fine. I have this also listed as a bug report for the said library. I couldn't find whether this is a Rails problem or a Wash Out problem. The params variable is available in normal controller actions.

Versions:

Upvotes: 0

Views: 738

Answers (1)

inossidabile
inossidabile

Reputation: 524

It's a bug of Savon actually %). Which got down on wash_out. To fix this for now just add "gem 'savon'" to your Gemfile. Will be fixed in upcoming version.

You should either upgrade to wash_out 0.3.0. It contains a lot of improvements and bug fixes.

Upvotes: 3

Related Questions