rubyjedi-actionwebservice 2.3.5.20100615120735 → 2.3.5.20100618223219

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. data/Rakefile +8 -4
  2. data/examples/googlesearch/autoloading/google_search_api.rb +1 -0
  3. data/examples/googlesearch/autoloading/google_search_controller.rb +1 -0
  4. data/examples/googlesearch/delegated/google_search_service.rb +1 -0
  5. data/examples/googlesearch/delegated/search_controller.rb +1 -0
  6. data/examples/googlesearch/direct/google_search_api.rb +1 -0
  7. data/examples/googlesearch/direct/search_controller.rb +1 -0
  8. data/examples/metaWeblog/apis/blogger_api.rb +1 -0
  9. data/examples/metaWeblog/apis/blogger_service.rb +1 -0
  10. data/examples/metaWeblog/apis/meta_weblog_api.rb +1 -0
  11. data/examples/metaWeblog/apis/meta_weblog_service.rb +1 -0
  12. data/examples/metaWeblog/controllers/xmlrpc_controller.rb +1 -0
  13. data/generators/web_service/templates/api_definition.rb +1 -0
  14. data/generators/web_service/templates/controller.rb +1 -0
  15. data/generators/web_service/templates/functional_test.rb +1 -0
  16. data/generators/web_service/web_service_generator.rb +1 -0
  17. data/lib/action_web_service.rb +1 -0
  18. data/lib/action_web_service/acts_as_web_service.rb +2 -1
  19. data/lib/action_web_service/api.rb +1 -0
  20. data/lib/action_web_service/base.rb +1 -0
  21. data/lib/action_web_service/casting.rb +13 -4
  22. data/lib/action_web_service/client.rb +1 -0
  23. data/lib/action_web_service/client/base.rb +1 -0
  24. data/lib/action_web_service/client/soap_client.rb +1 -0
  25. data/lib/action_web_service/client/xmlrpc_client.rb +1 -0
  26. data/lib/action_web_service/container.rb +1 -0
  27. data/lib/action_web_service/container/action_controller_container.rb +1 -0
  28. data/lib/action_web_service/container/delegated_container.rb +1 -0
  29. data/lib/action_web_service/container/direct_container.rb +1 -0
  30. data/lib/action_web_service/dispatcher.rb +1 -0
  31. data/lib/action_web_service/dispatcher/abstract.rb +1 -0
  32. data/lib/action_web_service/dispatcher/action_controller_dispatcher.rb +1 -0
  33. data/lib/action_web_service/invocation.rb +1 -0
  34. data/lib/action_web_service/protocol.rb +1 -0
  35. data/lib/action_web_service/protocol/abstract.rb +1 -0
  36. data/lib/action_web_service/protocol/discovery.rb +1 -0
  37. data/lib/action_web_service/protocol/soap_protocol.rb +1 -0
  38. data/lib/action_web_service/protocol/soap_protocol/marshaler.rb +1 -0
  39. data/lib/action_web_service/protocol/xmlrpc_protocol.rb +1 -0
  40. data/lib/action_web_service/scaffolding.rb +1 -0
  41. data/lib/action_web_service/simple.rb +2 -1
  42. data/lib/action_web_service/string_to_datetime_for_soap.rb +1 -0
  43. data/lib/action_web_service/struct.rb +1 -0
  44. data/lib/action_web_service/support/class_inheritable_options.rb +1 -0
  45. data/lib/action_web_service/support/signature_types.rb +1 -0
  46. data/lib/action_web_service/test_invoke.rb +1 -0
  47. data/lib/action_web_service/version.rb +1 -0
  48. data/lib/actionwebservice.rb +1 -0
  49. data/setup.rb +1 -0
  50. data/test/abstract_client.rb +1 -0
  51. data/test/abstract_dispatcher.rb +1 -0
  52. data/test/abstract_unit.rb +1 -0
  53. data/test/actionwebservice_unittest.db +0 -0
  54. data/test/api_test.rb +1 -0
  55. data/test/apis/auto_load_api.rb +1 -0
  56. data/test/apis/broken_auto_load_api.rb +1 -0
  57. data/test/base_test.rb +1 -0
  58. data/test/casting_test.rb +1 -0
  59. data/test/client_soap_test.rb +1 -0
  60. data/test/client_xmlrpc_test.rb +1 -0
  61. data/test/container_test.rb +1 -0
  62. data/test/dispatcher_action_controller_soap_test.rb +11 -3
  63. data/test/dispatcher_action_controller_xmlrpc_test.rb +1 -0
  64. data/test/invocation_test.rb +1 -0
  65. data/test/scaffolded_controller_test.rb +1 -0
  66. data/test/struct_test.rb +1 -0
  67. data/test/test_invoke_test.rb +1 -0
  68. metadata +5 -11
  69. data/test/debug.log +0 -12305
data/Rakefile CHANGED
@@ -25,9 +25,13 @@ task :default => [ :test ]
25
25
 
26
26
  # Run the unit tests
27
27
  Rake::TestTask.new { |t|
28
+ test_scope = ENV['SCOPE'] || '*'
29
+ t.test_files = FileList[ test_scope.split(',').collect{|scope| "test/#{scope}_test.rb"} ]
30
+
31
+ t.warning = !!ENV['WARNINGS']
32
+ t.verbose = !!ENV['VERBOSE']
33
+
28
34
  t.libs << "test"
29
- t.test_files = Dir['test/*_test.rb']
30
- t.verbose = true
31
35
  }
32
36
 
33
37
  SCHEMA_PATH = File.join(File.dirname(__FILE__), *%w(test fixtures db_definitions))
@@ -74,8 +78,8 @@ spec = Gem::Specification.new do |s|
74
78
  s.description = %q{Adds WSDL/SOAP and XML-RPC web service support to Action Pack}
75
79
  s.version = PKG_VERSION
76
80
 
77
- s.author = "Leon Breedt, Kent Sibilev"
78
- s.email = "bitserf@gmail.com, ksibilev@yahoo.com"
81
+ s.author = "Laurence A. Lee, Leon Breedt, Kent Sibilev"
82
+ s.email = "rubyjedi@gmail.com, bitserf@gmail.com, ksibilev@yahoo.com"
79
83
  s.rubyforge_project = "aws"
80
84
  s.homepage = "http://www.rubyonrails.org"
81
85
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class DirectoryCategory < ActionWebService::Struct
2
3
  member :fullViewableName, :string
3
4
  member :specialEncoding, :string
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class GoogleSearchController < ApplicationController
2
3
  wsdl_service_name 'GoogleSearch'
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class DirectoryCategory < ActionWebService::Struct
2
3
  member :fullViewableName, :string
3
4
  member :specialEncoding, :string
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'google_search_service'
2
3
 
3
4
  class SearchController < ApplicationController
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class DirectoryCategory < ActionWebService::Struct
2
3
  member :fullViewableName, :string
3
4
  member :specialEncoding, :string
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class SearchController < ApplicationController
2
3
  web_service_api :google_search
3
4
  wsdl_service_name 'GoogleSearch'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  #
2
3
  # see the blogger API spec at http://www.blogger.com/developers/api/1_docs/
3
4
  # note that the method signatures are subtly different to metaWeblog, they
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'blogger_api'
2
3
 
3
4
  class BloggerService < ActionWebService::Base
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  #
2
3
  # here lie structures, cousins of those on http://www.xmlrpc.com/metaWeblog
3
4
  # but they don't necessarily the real world reflect
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'meta_weblog_api'
2
3
 
3
4
  class MetaWeblogService < ActionWebService::Base
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  #
2
3
  # example controller implementing both blogger and metaWeblog APIs
3
4
  # in a way that should be compatible with clients supporting both/either.
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class <%= class_name %>Api < ActionWebService::API::Base
2
3
  <% for method_name in args -%>
3
4
  api_method :<%= method_name %>
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class <%= class_name %>Controller < ApplicationController
2
3
  wsdl_service_name '<%= class_name %>'
3
4
  <% for method_name in args -%>
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../test_helper'
2
3
  require '<%= file_path %>_controller'
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class WebServiceGenerator < Rails::Generator::NamedBase
2
3
  def manifest
3
4
  record do |m|
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  #--
2
3
  # Copyright (C) 2005 Leon Breedt
3
4
  #
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService
2
3
  module ActsAsWebService
3
4
 
@@ -21,4 +22,4 @@ module ActionWebService
21
22
  end
22
23
  end
23
24
  end
24
- end
25
+ end
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService # :nodoc:
2
3
  module API # :nodoc:
3
4
  # A web service API class specifies the methods that will be available for
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService # :nodoc:
2
3
  class ActionWebServiceError < StandardError # :nodoc:
3
4
  end
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'time'
2
3
  require 'date'
3
4
  require 'xmlrpc/datetime'
@@ -100,8 +101,10 @@ module ActionWebService # :nodoc:
100
101
  when :decimal
101
102
  BigDecimal(value.to_s)
102
103
  when :time
103
- value = "%s/%s/%s %s:%s:%s" % value.values_at(*%w[2 3 1 4 5 6]) if value.kind_of?(Hash)
104
- if value.kind_of?(Time)
104
+ if value.kind_of?(Hash)
105
+ value = "%s/%s/%s %s:%s:%s" % value.values_at(*%w[2 3 1 4 5 6])
106
+ Time.respond_to?(:strptime) ? Time.strptime(value.to_s, "%m/%d/%Y %H:%M:%S") : Time.parse(value.to_s)
107
+ elsif value.kind_of?(Time)
105
108
  value
106
109
  elsif value.kind_of?(DateTime)
107
110
  value.to_time
@@ -109,10 +112,16 @@ module ActionWebService # :nodoc:
109
112
  Time.parse(value.to_s)
110
113
  end
111
114
  when :date
112
- value = "%s/%s/%s" % value.values_at(*%w[2 3 1]) if value.kind_of?(Hash)
115
+ if value.kind_of?(Hash)
116
+ value = "%s/%s/%s" % value.values_at(*%w[2 3 1])
117
+ return Date.strptime(value.to_s,"%m/%d/%Y")
118
+ end
113
119
  value.kind_of?(Date) ? value : Date.parse(value.to_s)
114
120
  when :datetime
115
- value = "%s/%s/%s %s:%s:%s" % value.values_at(*%w[2 3 1 4 5 6]) if value.kind_of?(Hash)
121
+ if value.kind_of?(Hash)
122
+ value = "%s/%s/%s %s:%s:%s" % value.values_at(*%w[2 3 1 4 5 6])
123
+ return DateTime.strptime(value.to_s,"%m/%d/%Y %H:%M:%S")
124
+ end
116
125
  value.kind_of?(DateTime) ? value : DateTime.parse(value.to_s)
117
126
  end
118
127
  end
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'action_web_service/client/base'
2
3
  require 'action_web_service/client/soap_client'
3
4
  require 'action_web_service/client/xmlrpc_client'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService # :nodoc:
2
3
  module Client # :nodoc:
3
4
  class ClientError < StandardError # :nodoc:
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'soap/rpc/driver'
2
3
  require 'uri'
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'uri'
2
3
  require 'xmlrpc/client'
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'action_web_service/container/direct_container'
2
3
  require 'action_web_service/container/delegated_container'
3
4
  require 'action_web_service/container/action_controller_container'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService # :nodoc:
2
3
  module Container # :nodoc:
3
4
  module ActionController # :nodoc:
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService # :nodoc:
2
3
  module Container # :nodoc:
3
4
  module Delegated # :nodoc:
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService # :nodoc:
2
3
  module Container # :nodoc:
3
4
  module Direct # :nodoc:
@@ -1,2 +1,3 @@
1
+ # encoding: UTF-8
1
2
  require 'action_web_service/dispatcher/abstract'
2
3
  require 'action_web_service/dispatcher/action_controller_dispatcher'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'benchmark'
2
3
 
3
4
  module ActionWebService # :nodoc:
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'benchmark'
2
3
  require 'builder/xmlmarkup'
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService # :nodoc:
2
3
  module Invocation # :nodoc:
3
4
  class InvocationError < ActionWebService::ActionWebServiceError # :nodoc:
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'action_web_service/protocol/abstract'
2
3
  require 'action_web_service/protocol/discovery'
3
4
  require 'action_web_service/protocol/soap_protocol'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService # :nodoc:
2
3
  module Protocol # :nodoc:
3
4
  class ProtocolError < ActionWebServiceError # :nodoc:
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService # :nodoc:
2
3
  module Protocol # :nodoc:
3
4
  module Discovery # :nodoc:
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'action_web_service/protocol/soap_protocol/marshaler'
2
3
  require 'soap/streamHandler'
3
4
  require 'action_web_service/client/soap_client'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'soap/mapping'
2
3
 
3
4
  # hack to improve the .Net interoperability
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'xmlrpc/marshal'
2
3
  require 'action_web_service/client/xmlrpc_client'
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'benchmark'
2
3
  require 'pathname'
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService
2
3
  # To send simple types across the wire, derive from ActionWebService::Simple,
3
4
  # and use +base+ to declare the base type for it restriction and,
@@ -50,4 +51,4 @@ module ActionWebService
50
51
 
51
52
  end
52
53
 
53
- end
54
+ end
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module StringToDatetimeForSoap
2
3
  def to_datetime
3
4
  begin
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService
2
3
  # To send structured types across the wire, derive from ActionWebService::Struct,
3
4
  # and use +member+ to declare structure members.
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class Class # :nodoc:
2
3
  def class_inheritable_option(sym, default_value=nil)
3
4
  write_inheritable_attribute sym, default_value
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService # :nodoc:
2
3
  # Action Web Service supports the following base types in a signature:
3
4
  #
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'test/unit'
2
3
 
3
4
  module Test # :nodoc:
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module ActionWebService
2
3
  module VERSION #:nodoc:
3
4
  MAJOR = 2
@@ -1 +1,2 @@
1
+ # encoding: UTF-8
1
2
  require 'action_web_service'
data/setup.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  #
2
3
  # setup.rb
3
4
  #
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'abstract_unit'
2
3
  require 'webrick'
3
4
  require 'webrick/log'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'abstract_unit'
2
3
  require 'stringio'
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  $: << "#{File.dirname(__FILE__)}/../lib"
2
3
  ENV["RAILS_ENV"] = "test"
3
4
  require 'rubygems'
Binary file
data/test/api_test.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'abstract_unit'
2
3
 
3
4
  module APITest
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  class AutoLoadAPI < ActionWebService::API::Base
2
3
  api_method :void
3
4
  end
@@ -1,2 +1,3 @@
1
+ # encoding: UTF-8
1
2
 
2
3
 
data/test/base_test.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'abstract_unit'
2
3
 
3
4
  module BaseTest
data/test/casting_test.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'abstract_unit'
2
3
 
3
4
  module CastingTest
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'abstract_client'
2
3
 
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'abstract_client'
2
3
 
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'abstract_unit'
2
3
 
3
4
  module ContainerTest
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  $:.unshift(File.dirname(__FILE__) + '/apis')
2
3
  require 'abstract_dispatcher'
3
4
  require 'wsdl/parser'
@@ -69,8 +70,13 @@ class TC_DispatcherActionControllerSoap < Test::Unit::TestCase
69
70
 
70
71
  def test_utf8
71
72
  @direct_controller.web_service_exception_reporting = true
72
- $KCODE = 'u'
73
- assert_equal(Utf8String, do_method_call(@direct_controller, 'TestUtf8'))
73
+ if RUBY_VERSION.to_f >= 1.9
74
+ utf8_string = Utf8String.force_encoding('UTF-8')
75
+ else
76
+ $KCODE = 'u'
77
+ utf8_string = Utf8String.to_s
78
+ end
79
+ assert_equal(utf8_string, do_method_call(@direct_controller, 'TestUtf8'))
74
80
  retval = SOAP::Processor.unmarshal(@response_body).body.response
75
81
  assert retval.is_a?(SOAP::SOAPString)
76
82
 
@@ -78,7 +84,9 @@ class TC_DispatcherActionControllerSoap < Test::Unit::TestCase
78
84
  # will be sent back as base64 by SOAP4R. By the time we get it here though,
79
85
  # it will be decoded back into a string. So lets read the base64 value
80
86
  # from the message body directly.
81
- $KCODE = 'NONE'
87
+ unless RUBY_VERSION.to_f >= 1.9
88
+ $KCODE = 'NONE'
89
+ end
82
90
  do_method_call(@direct_controller, 'TestUtf8')
83
91
  retval = SOAP::Processor.unmarshal(@response_body).body.response
84
92
  # not sure why this test fails but too lazy to find out why :-(