Philip Hallstrom
2006-Jun-07 23:40 UTC
[Rails] Web Service: NoMethodError (missing attribute: featured) !?!?!?!?!
Hi all - I have a Player model. The database looks like this: +-------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | fname | varchar(255) | YES | | NULL | | | lname | varchar(255) | YES | | NULL | | | nickname | varchar(255) | YES | | NULL | | | city | varchar(50) | YES | | NULL | | | state | varchar(50) | YES | | NULL | | | country | varchar(75) | YES | | NULL | | | hide | tinyint(1) | YES | | NULL | | | hendon_id | int(11) | YES | | NULL | | | times_viewed | int(11) | YES | | NULL | | | lifetime_winnings | int(11) | YES | | NULL | | | created_at | datetime | YES | | NULL | | | updated_at | datetime | YES | | NULL | | | featured | tinyint(1) | YES | | NULL | | +-------------------+--------------+------+-----+---------+----------------+>From the web, and from within the console things work fine. For exampleI can do: Player.find(99) and it works great. I''ve also got a web service setup. If I do the same thing through the API, I get this an error "missing attribute: featured" (see log below). If I drop that column, all is well. Moving it around doesn''t do any good. Neither does renaming it. I''m completely baffled. I''m not doing anything special with that column that I''m aware of... ??? Thanks! ------------------------------------------------------------------------------------------------------------------------ Web Service Request: player.find_by_id(id=>99) Entrypoint: player <?xml version="1.0" ?><methodCall><methodName>player.find_by_id</methodName><params><param><value><i4>99</i4></value></param></params></methodCall> NoMethodError (missing attribute: featured): /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/casting.rb:125:in `cast_to_structured_type'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/support/signature_types.rb:206:in `each_member'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/support/signature_types.rb:205:in `each_member'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/casting.rb:124:in `cast_to_structured_type'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/casting.rb:60:in `cast'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/casting.rb:38:in `cast_returns'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/casting.rb:25:in `cast_returns'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/api.rb:193:in `cast_returns'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/dispatcher/abstract.rb:182:in `web_service_create_response'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/dispatcher/abstract.rb:59:in `web_service_invoke'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/dispatcher/abstract.rb:22:in `invoke_web_service_request'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:53:in `dispatch_web_service_request'' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:51:in `dispatch_web_service_request'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/scaffolding.rb:83:in `invoke_submit'' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/scaffolding.rb:67:in `invoke_submit'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:910:in `perform_action_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:368:in `perform_action_without_benchmark'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue'' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:82:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in `process_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:377:in `process_without_session_management_support'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in `process'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:150:in `process_request'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:54:in `process!'' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi'' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:53:in `process!'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:23:in `process!'' /cpr/web/public/dispatch.fcgi:24 ------------------------------------------------------------------------------------------------------------------------
Philip Hallstrom
2006-Jun-08 00:06 UTC
[Rails] Web Service: NoMethodError (missing attribute: featured) !?!?!?!?! (SOLVED)
I am an idiot. Note to all. Check your cache stores first. *sigh* On Wed, 7 Jun 2006, Philip Hallstrom wrote:> Hi all - > > I have a Player model. The database looks like this: > > +-------------------+--------------+------+-----+---------+----------------+ > | Field | Type | Null | Key | Default | Extra | > +-------------------+--------------+------+-----+---------+----------------+ > | id | int(11) | NO | PRI | NULL | auto_increment | > | fname | varchar(255) | YES | | NULL | | > | lname | varchar(255) | YES | | NULL | | > | nickname | varchar(255) | YES | | NULL | | > | city | varchar(50) | YES | | NULL | | > | state | varchar(50) | YES | | NULL | | > | country | varchar(75) | YES | | NULL | | > | hide | tinyint(1) | YES | | NULL | | > | hendon_id | int(11) | YES | | NULL | | > | times_viewed | int(11) | YES | | NULL | | > | lifetime_winnings | int(11) | YES | | NULL | | > | created_at | datetime | YES | | NULL | | > | updated_at | datetime | YES | | NULL | | > | featured | tinyint(1) | YES | | NULL | | > +-------------------+--------------+------+-----+---------+----------------+ > >> From the web, and from within the console things work fine. For example > I can do: Player.find(99) and it works great. > > I''ve also got a web service setup. If I do the same thing through the > API, I get this an error "missing attribute: featured" (see log below). > > If I drop that column, all is well. Moving it around doesn''t do any > good. Neither does renaming it. I''m completely baffled. I''m not doing > anything special with that column that I''m aware of... > > ??? > > Thanks! > > > ------------------------------------------------------------------------------------------------------------------------ > Web Service Request: player.find_by_id(id=>99) Entrypoint: player > <?xml version="1.0" > ?><methodCall><methodName>player.find_by_id</methodName><params><param><value><i4>99</i4></value></param></params></methodCall> > > > NoMethodError (missing attribute: featured): > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/casting.rb:125:in > `cast_to_structured_type'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/support/signature_types.rb:206:in > `each_member'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/support/signature_types.rb:205:in > `each_member'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/casting.rb:124:in > `cast_to_structured_type'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/casting.rb:60:in > `cast'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/casting.rb:38:in > `cast_returns'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/casting.rb:25:in > `cast_returns'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/api.rb:193:in > `cast_returns'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/dispatcher/abstract.rb:182:in > `web_service_create_response'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/dispatcher/abstract.rb:59:in > `web_service_invoke'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/dispatcher/abstract.rb:22:in > `invoke_web_service_request'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:53:in > `dispatch_web_service_request'' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:51:in > `dispatch_web_service_request'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/scaffolding.rb:83:in > `invoke_submit'' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/scaffolding.rb:67:in > `invoke_submit'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:910:in > `perform_action_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:368:in > `perform_action_without_benchmark'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:82:in > `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in > `process_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:377:in > `process_without_session_management_support'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in > `process'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in > `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:150:in > `process_request'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:54:in > `process!'' > /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi'' > /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:53:in > `process!'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:23:in > `process!'' > /cpr/web/public/dispatch.fcgi:24 > ------------------------------------------------------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >