Using the web service example from the Agile Web D. with Rails
book (first edition, chapter 20, p 413) results in a date parse error
when the Person object is returned from the call find_product_by_id. I
am using Rails 1.16 with SQL Server 2000. Has anyone experienced similar
behaviour?
regards,
C.
class ProductApi < ActionWebService::API::Base
api_method :find_all_products,
:returns => [[:int]]
api_method :find_product_by_id,
:expects => [:int],
:returns => [:date]
end
class BackendController < ApplicationController
wsdl_service_name ‘Backend’
web_service_api ProductApi
web_service_scaffold :invoke
def find_all_products
Product.find(:all).map{ |product| product.id }
end
def find_product_by_id(id)
product = Product.find(id)
end
end
{{{
ArgumentError in BackendController#invoke_submit
3 elements of civil date are necessary
RAILS_ROOT: ./script/…/config/…
Application Trace | Framework Trace | Full Trace
c:/Program Files/Ruby/lib/ruby/1.8/date.rb:650:in new_with_hash' c:/Program Files/Ruby/lib/ruby/1.8/date.rb:695:in
parse’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/casting.rb:103:in
cast_base_type' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/casting.rb:62:in
cast’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/casting.rb:38:in
cast_returns' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/casting.rb:25:in
cast_returns’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/api.rb:193:in
cast_returns' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/abstract.rb:182:in
web_service_create_response’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/abstract.rb:59:in
web_service_invoke' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/abstract.rb:22:in
invoke_web_service_request’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:53:in
dispatch_web_service_request' c:/Program Files/Ruby/lib/ruby/1.8/benchmark.rb:293:in
measure’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:51:in
dispatch_web_service_request' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/scaffolding.rb:83:in
invoke_submit’
c:/Program Files/Ruby/lib/ruby/1.8/benchmark.rb:293:in measure' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/scaffolding.rb:67:in
invoke_submit’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:941:in
perform_action_without_filters' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:368:in
perform_action_without_benchmark’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' c:/Program Files/Ruby/lib/ruby/1.8/benchmark.rb:293:in
measure’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:in
perform_action’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in
process_without_filters' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in
process_without_session_management_support’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in
process' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in
dispatch’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:115:in
handle_dispatch' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:81:in
service’
c:/Program Files/Ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in
service' c:/Program Files/Ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in
run’
c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:173:in
start_thread' c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:162:in
start_thread’
c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:95:in start' c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:92:in
start’
c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:23:in start' c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:82:in
start’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:67:in
dispatch' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/servers/webrick.rb:59 c:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
require' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/server.rb:30 c:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
require' script/server:3 -e:4 c:/Program Files/Ruby/lib/ruby/1.8/date.rb:650:in
new_with_hash’
c:/Program Files/Ruby/lib/ruby/1.8/date.rb:695:in parse' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/casting.rb:103:in
cast_base_type’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/casting.rb:62:in
cast' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/casting.rb:38:in
cast_returns’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/casting.rb:25:in
cast_returns' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/api.rb:193:in
cast_returns’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/abstract.rb:182:in
web_service_create_response' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/abstract.rb:59:in
web_service_invoke’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/abstract.rb:22:in
invoke_web_service_request' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:53:in
dispatch_web_service_request’
c:/Program Files/Ruby/lib/ruby/1.8/benchmark.rb:293:in measure' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:51:in
dispatch_web_service_request’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/scaffolding.rb:83:in
invoke_submit' c:/Program Files/Ruby/lib/ruby/1.8/benchmark.rb:293:in
measure’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/scaffolding.rb:67:in
invoke_submit' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:941:in
perform_action_without_filters’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:368:in
perform_action_without_benchmark' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue’
c:/Program Files/Ruby/lib/ruby/1.8/benchmark.rb:293:in measure' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:in
perform_action' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in
process_without_filters’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in
process_without_session_management_support' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in
process’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in
dispatch' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:115:in
handle_dispatch’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:81:in
service' c:/Program Files/Ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in
service’
c:/Program Files/Ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in run' c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:173:in
start_thread’
c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:162:in
start_thread' c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:95:in
start’
c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:92:in start' c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:23:in
start’
c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:82:in start' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:67:in
dispatch’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/servers/webrick.rb:59
c:/Program
Files/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
require’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/server.rb:30
c:/Program
Files/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
require’
script/server:3
c:/Program Files/Ruby/lib/ruby/1.8/date.rb:650:in new_with_hash' c:/Program Files/Ruby/lib/ruby/1.8/date.rb:695:in
parse’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/casting.rb:103:in
cast_base_type' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/casting.rb:62:in
cast’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/casting.rb:38:in
cast_returns' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/casting.rb:25:in
cast_returns’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/api.rb:193:in
cast_returns' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/abstract.rb:182:in
web_service_create_response’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/abstract.rb:59:in
web_service_invoke' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/abstract.rb:22:in
invoke_web_service_request’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:53:in
dispatch_web_service_request' c:/Program Files/Ruby/lib/ruby/1.8/benchmark.rb:293:in
measure’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:51:in
dispatch_web_service_request' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/scaffolding.rb:83:in
invoke_submit’
c:/Program Files/Ruby/lib/ruby/1.8/benchmark.rb:293:in measure' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/scaffolding.rb:67:in
invoke_submit’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:941:in
perform_action_without_filters' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:368:in
perform_action_without_benchmark’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' c:/Program Files/Ruby/lib/ruby/1.8/benchmark.rb:293:in
measure’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:in
perform_action’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in
process_without_filters' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in
process_without_session_management_support’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in
process' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in
dispatch’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:115:in
handle_dispatch' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:81:in
service’
c:/Program Files/Ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in
service' c:/Program Files/Ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in
run’
c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:173:in
start_thread' c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:162:in
start_thread’
c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:95:in start' c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:92:in
start’
c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:23:in start' c:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:82:in
start’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:67:in
dispatch' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/servers/webrick.rb:59 c:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
require' c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/server.rb:30 c:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require’
c:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require’
script/server:3
-e:4
Request
Parameters: {“commit”=>“Invoke”, “protocol”=>“soap”,
“service”=>“backend”, “method”=>“FindProductById”,
“method_params”=>{“0”=>“1”}}
Show session dump
Response
Headers: {“cookie”=>[], “Cache-Control”=>“no-cache”}
}}}