2012-01-05 43 views
0

我正在按照Wash_Out页面上的指南进行操作。而我得到以下错误,当我打电话的SOAP方法之一:在Rails 3.1中使用wash_out时无值参数

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.[]): 

的API控制器看起来像这样

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 

到WSDL的请求,运行正常。对于上述图书馆,我也将其列为bug report。我找不到这是Rails问题还是Wash Out问题。 params变量在正常控制器操作中可用。

版本:

  • 的Rails 3.1.3
  • wash_out 0.2.3
  • 的Ruby 1.9.3

回答

3

这是莎翁的错误实际上%)。在wash_out上下来了。现在只需将“gem'savon'”添加到您的Gemfile中即可解决此问题。将在即将推出的版本中修复。

您应该升级到wash_out 0.3.0。它包含许多改进和错误修复。

+0

其实我是在GitHub上打开这个问题的同一个人。 :)我忘了关闭这个并添加信息。抱歉 – 2012-01-25 22:48:53