Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError, undefined method `values_at' for nil:NilClass while testing actions #118

Closed
weimeng opened this issue Sep 26, 2013 · 5 comments

Comments

@weimeng
Copy link

weimeng commented Sep 26, 2013

I get the following internal server error while testing wash_out with SoapUI:

Started POST "/rumbas/action" for 127.0.0.1 at 2013-09-26 15:02:45 +0800
Processing by RumbasController#integer_to_string as HTML
  Parameters: {"Envelope"=>{"xmlns:soapenv"=>"http://schemas.xmlsoap.org/soap/envelope/", "Header"=>nil, "Body"=>{"value"=>"5"}}}
Completed 500 Internal Server Error in 1ms

NoMethodError (undefined method `values_at' for nil:NilClass):
  config/initializers/quiet_assets.rb:6:in `call_with_quiet_assets'


  Rendered /Users/weimeng/.rvm/gems/ruby-1.9.2-p320@my_application/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.6ms)
  Rendered /Users/weimeng/.rvm/gems/ruby-1.9.2-p320@my_application/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.1ms)
  Rendered /Users/weimeng/.rvm/gems/ruby-1.9.2-p320@my_application/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (32.1ms)

I'm fairly confused because I'm following the README exactly but am unable to get this to work.

I noticed that there's a similar issue (#100) but I don't have the problem which the person faced as I've made a new controller just for wash_out.

Do you have any advice as to what I might be doing wrong here?

This is my controller:

class RumbasController < ActionController::Base
  soap_service namespace: "test"

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

These are my routes:

MyApplication::Application.routes.draw do
  wash_out :rumbas
end
@weimeng
Copy link
Author

weimeng commented Sep 26, 2013

This is from the Rails framework trace:

/Users/weimeng/.rvm/gems/ruby-1.9.2-p320@my_application/bundler/gems/wash_out-31cbe18b4926/lib/wash_out/dispatcher.rb:53:in `_map_soap_parameters'

@weimeng
Copy link
Author

weimeng commented Sep 27, 2013

Not sure if I'm barking up the wrong tree here, but here's what I found.

If I do a request.raw_post before @_params = nori_parser.parse(request.body.read) in WashOut::Dispatcher#_parse_soap_parameters, then request.body is not empty and everything works as per normal after.

Any idea what's causing this?

@alagunambi
Copy link

@weimeng can you try the parameters in the following format, and check?
Parameters: {"Envelope"=>{"xmlns:soapenv"=>"http://schemas.xmlsoap.org/soap/envelope/", "Header"=>nil, "Body"=>{ "IntegerToString" => { value"=>"5" }}}}

@inossidabile
Copy link
Owner

Thanks for the catch.

@weimeng
Copy link
Author

weimeng commented Sep 30, 2013

@inossidabile Glad I could help. Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants