keeguon-actionwebservice 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. data/CHANGELOG +335 -0
  2. data/MIT-LICENSE +21 -0
  3. data/README +381 -0
  4. data/Rakefile +184 -0
  5. data/TODO +32 -0
  6. data/examples/googlesearch/README +143 -0
  7. data/examples/googlesearch/autoloading/google_search_api.rb +51 -0
  8. data/examples/googlesearch/autoloading/google_search_controller.rb +58 -0
  9. data/examples/googlesearch/delegated/google_search_service.rb +109 -0
  10. data/examples/googlesearch/delegated/search_controller.rb +8 -0
  11. data/examples/googlesearch/direct/google_search_api.rb +51 -0
  12. data/examples/googlesearch/direct/search_controller.rb +59 -0
  13. data/examples/metaWeblog/README +17 -0
  14. data/examples/metaWeblog/apis/blogger_api.rb +61 -0
  15. data/examples/metaWeblog/apis/blogger_service.rb +35 -0
  16. data/examples/metaWeblog/apis/meta_weblog_api.rb +68 -0
  17. data/examples/metaWeblog/apis/meta_weblog_service.rb +49 -0
  18. data/examples/metaWeblog/controllers/xmlrpc_controller.rb +17 -0
  19. data/generators/web_service/USAGE +28 -0
  20. data/generators/web_service/templates/api_definition.rb +6 -0
  21. data/generators/web_service/templates/controller.rb +9 -0
  22. data/generators/web_service/templates/functional_test.rb +20 -0
  23. data/generators/web_service/web_service_generator.rb +30 -0
  24. data/lib/action_web_service/acts_as_web_service.rb +26 -0
  25. data/lib/action_web_service/api.rb +298 -0
  26. data/lib/action_web_service/base.rb +39 -0
  27. data/lib/action_web_service/casting.rb +160 -0
  28. data/lib/action_web_service/client/base.rb +29 -0
  29. data/lib/action_web_service/client/soap_client.rb +114 -0
  30. data/lib/action_web_service/client/xmlrpc_client.rb +59 -0
  31. data/lib/action_web_service/client.rb +4 -0
  32. data/lib/action_web_service/container/action_controller_container.rb +94 -0
  33. data/lib/action_web_service/container/delegated_container.rb +87 -0
  34. data/lib/action_web_service/container/direct_container.rb +70 -0
  35. data/lib/action_web_service/container.rb +4 -0
  36. data/lib/action_web_service/dispatcher/abstract.rb +209 -0
  37. data/lib/action_web_service/dispatcher/action_controller_dispatcher.rb +420 -0
  38. data/lib/action_web_service/dispatcher.rb +3 -0
  39. data/lib/action_web_service/invocation.rb +203 -0
  40. data/lib/action_web_service/protocol/abstract.rb +113 -0
  41. data/lib/action_web_service/protocol/discovery.rb +38 -0
  42. data/lib/action_web_service/protocol/soap_protocol/marshaler.rb +243 -0
  43. data/lib/action_web_service/protocol/soap_protocol.rb +181 -0
  44. data/lib/action_web_service/protocol/xmlrpc_protocol.rb +124 -0
  45. data/lib/action_web_service/protocol.rb +5 -0
  46. data/lib/action_web_service/scaffolding.rb +282 -0
  47. data/lib/action_web_service/simple.rb +54 -0
  48. data/lib/action_web_service/string_to_datetime_for_soap.rb +17 -0
  49. data/lib/action_web_service/struct.rb +69 -0
  50. data/lib/action_web_service/support/class_inheritable_options.rb +27 -0
  51. data/lib/action_web_service/support/signature_types.rb +262 -0
  52. data/lib/action_web_service/templates/scaffolds/layout.html.erb +65 -0
  53. data/lib/action_web_service/templates/scaffolds/methods.html.erb +6 -0
  54. data/lib/action_web_service/templates/scaffolds/parameters.html.erb +29 -0
  55. data/lib/action_web_service/templates/scaffolds/result.html.erb +30 -0
  56. data/lib/action_web_service/test_invoke.rb +111 -0
  57. data/lib/action_web_service/version.rb +10 -0
  58. data/lib/action_web_service.rb +61 -0
  59. data/lib/actionwebservice.rb +2 -0
  60. data/setup.rb +1380 -0
  61. data/test/abstract_client.rb +185 -0
  62. data/test/abstract_dispatcher.rb +550 -0
  63. data/test/abstract_unit.rb +44 -0
  64. data/test/api_test.rb +103 -0
  65. data/test/apis/auto_load_api.rb +4 -0
  66. data/test/apis/broken_auto_load_api.rb +3 -0
  67. data/test/base_test.rb +43 -0
  68. data/test/casting_test.rb +96 -0
  69. data/test/client_soap_test.rb +157 -0
  70. data/test/client_xmlrpc_test.rb +155 -0
  71. data/test/container_test.rb +76 -0
  72. data/test/dispatcher_action_controller_soap_test.rb +147 -0
  73. data/test/dispatcher_action_controller_xmlrpc_test.rb +60 -0
  74. data/test/fixtures/db_definitions/mysql.sql +8 -0
  75. data/test/fixtures/db_definitions/sqlite3.sql +8 -0
  76. data/test/fixtures/users.yml +12 -0
  77. data/test/gencov +3 -0
  78. data/test/invocation_test.rb +187 -0
  79. data/test/run +6 -0
  80. data/test/scaffolded_controller_test.rb +148 -0
  81. data/test/struct_test.rb +85 -0
  82. data/test/test_invoke_test.rb +114 -0
  83. metadata +175 -0
@@ -0,0 +1,262 @@
1
+ # encoding: UTF-8
2
+ module ActionWebService # :nodoc:
3
+ # Action Web Service supports the following base types in a signature:
4
+ #
5
+ # [<tt>:int</tt>] Represents an integer value, will be cast to an integer using <tt>Integer(value)</tt>
6
+ # [<tt>:string</tt>] Represents a string value, will be cast to an string using the <tt>to_s</tt> method on an object
7
+ # [<tt>:base64</tt>] Represents a Base 64 value, will contain the binary bytes of a Base 64 value sent by the caller
8
+ # [<tt>:bool</tt>] Represents a boolean value, whatever is passed will be cast to boolean (<tt>true</tt>, '1', 'true', 'y', 'yes' are taken to represent true; <tt>false</tt>, '0', 'false', 'n', 'no' and <tt>nil</tt> represent false)
9
+ # [<tt>:float</tt>] Represents a floating point value, will be cast to a float using <tt>Float(value)</tt>
10
+ # [<tt>:time</tt>] Represents a timestamp, will be cast to a <tt>Time</tt> object
11
+ # [<tt>:datetime</tt>] Represents a timestamp, will be cast to a <tt>DateTime</tt> object
12
+ # [<tt>:date</tt>] Represents a date, will be cast to a <tt>Date</tt> object
13
+ #
14
+ # For structured types, you'll need to pass in the Class objects of
15
+ # ActionWebService::Struct and ActiveRecord::Base derivatives.
16
+ module SignatureTypes
17
+ def canonical_signature(signature) # :nodoc:
18
+ return nil if signature.nil?
19
+ unless signature.is_a?(Array)
20
+ raise(ActionWebServiceError, "Expected signature to be an Array")
21
+ end
22
+ i = -1
23
+ signature.map{ |spec| canonical_signature_entry(spec, i += 1) }
24
+ end
25
+
26
+ def canonical_signature_entry(spec, i) # :nodoc:
27
+ orig_spec = spec
28
+ name = "param#{i}"
29
+ if spec.is_a?(Hash)
30
+ name, spec = spec.keys.first, spec.values.first
31
+ end
32
+ type = spec
33
+ if spec.is_a?(Array)
34
+ ArrayType.new(orig_spec, canonical_signature_entry(spec[0], 0), name)
35
+ else
36
+ type = canonical_type(type)
37
+ if type.is_a?(Symbol)
38
+ BaseType.new(orig_spec, type, name)
39
+ else
40
+ if type.is_a?(Hash)
41
+ complexity, type = type.keys.first.to_sym, type.values.first
42
+ end
43
+ element = complexity || :complex
44
+ element == :simple ? SimpleType.new(orig_spec, type, name) : StructuredType.new(orig_spec, type, name)
45
+ end
46
+ end
47
+ end
48
+
49
+ def canonical_type(type) # :nodoc:
50
+ type_name = symbol_name(type) || class_to_type_name(type)
51
+ type = type_name || type
52
+ return canonical_type_name(type) if type.is_a?(Symbol)
53
+ type
54
+ end
55
+
56
+ def canonical_type_name(name) # :nodoc:
57
+ name = name.to_sym
58
+ case name
59
+ when :int, :integer, :fixnum, :bignum
60
+ :int
61
+ when :string, :text
62
+ :string
63
+ when :base64, :binary
64
+ :base64
65
+ when :bool, :boolean
66
+ :bool
67
+ when :float, :double
68
+ :float
69
+ when :decimal
70
+ :decimal
71
+ when :time, :timestamp
72
+ :time
73
+ when :datetime
74
+ :datetime
75
+ when :date
76
+ :date
77
+ else
78
+ raise(TypeError, "#{name} is not a valid base type")
79
+ end
80
+ end
81
+
82
+ def canonical_type_class(type) # :nodoc:
83
+ type = canonical_type(type)
84
+ type.is_a?(Symbol) ? type_name_to_class(type) : type
85
+ end
86
+
87
+ def symbol_name(name) # :nodoc:
88
+ return name.to_sym if name.is_a?(Symbol) || name.is_a?(String)
89
+ nil
90
+ end
91
+
92
+ def class_to_type_name(klass) # :nodoc:
93
+ klass = klass.class unless klass.is_a?(Class)
94
+ if derived_from?(Integer, klass) || derived_from?(Fixnum, klass) || derived_from?(Bignum, klass)
95
+ :int
96
+ elsif klass == String
97
+ :string
98
+ elsif klass == Base64
99
+ :base64
100
+ elsif klass == TrueClass || klass == FalseClass
101
+ :bool
102
+ elsif derived_from?(Float, klass)
103
+ :float
104
+ elsif RUBY_VERSION < '1.9' && derived_from?(Precision, klass)
105
+ :float
106
+ elsif derived_from?(Numeric, klass)
107
+ :float
108
+ elsif klass == Time
109
+ :time
110
+ elsif klass == DateTime
111
+ :datetime
112
+ elsif klass == Date
113
+ :date
114
+ else
115
+ nil
116
+ end
117
+ end
118
+
119
+ def type_name_to_class(name) # :nodoc:
120
+ case canonical_type_name(name)
121
+ when :int
122
+ Integer
123
+ when :string
124
+ String
125
+ when :base64
126
+ Base64
127
+ when :bool
128
+ TrueClass
129
+ when :float
130
+ Float
131
+ when :decimal
132
+ BigDecimal
133
+ when :time
134
+ Time
135
+ when :date
136
+ Date
137
+ when :datetime
138
+ DateTime
139
+ else
140
+ nil
141
+ end
142
+ end
143
+
144
+ def derived_from?(ancestor, child) # :nodoc:
145
+ child.ancestors.include?(ancestor)
146
+ end
147
+
148
+ module_function :type_name_to_class
149
+ module_function :class_to_type_name
150
+ module_function :symbol_name
151
+ module_function :canonical_type_class
152
+ module_function :canonical_type_name
153
+ module_function :canonical_type
154
+ module_function :canonical_signature_entry
155
+ module_function :canonical_signature
156
+ module_function :derived_from?
157
+ end
158
+
159
+ class BaseType # :nodoc:
160
+ include SignatureTypes
161
+
162
+ attr :spec
163
+ attr :type
164
+ attr :type_class
165
+ attr :name
166
+
167
+ def initialize(spec, type, name)
168
+ @spec = spec
169
+ @type = canonical_type(type)
170
+ @type_class = canonical_type_class(@type)
171
+ @name = name
172
+ end
173
+
174
+ def custom?
175
+ false
176
+ end
177
+
178
+ def array?
179
+ false
180
+ end
181
+
182
+ def structured?
183
+ false
184
+ end
185
+
186
+ def simple?
187
+ false
188
+ end
189
+
190
+ def human_name(show_name=true)
191
+ type_type = array? ? element_type.type.to_s : self.type.to_s
192
+ str = array? ? (type_type + '[]') : type_type
193
+ show_name ? (str + " " + name.to_s) : str
194
+ end
195
+ end
196
+
197
+ class ArrayType < BaseType # :nodoc:
198
+ attr :element_type
199
+
200
+ def initialize(spec, element_type, name)
201
+ super(spec, Array, name)
202
+ @element_type = element_type
203
+ end
204
+
205
+ def custom?
206
+ true
207
+ end
208
+
209
+ def array?
210
+ true
211
+ end
212
+ end
213
+
214
+ class StructuredType < BaseType # :nodoc:
215
+ def each_member
216
+ if @type_class.respond_to?(:members)
217
+ @type_class.members.each do |name, type_options|
218
+ type, options = type_options
219
+ yield name, type, options
220
+ end
221
+ elsif @type_class.respond_to?(:columns)
222
+ i = -1
223
+ @type_class.columns.each do |column|
224
+ yield column.name, canonical_signature_entry(column.type, i += 1)
225
+ end
226
+ end
227
+ end
228
+
229
+ def custom?
230
+ true
231
+ end
232
+
233
+ def structured?
234
+ true
235
+ end
236
+ end
237
+
238
+ class SimpleType < BaseType # :nodoc:
239
+ def base
240
+ @type_class.restriction_base if @type_class.respond_to?(:restriction_base)
241
+ end
242
+
243
+ def restrictions
244
+ if @type_class.respond_to?(:restrictions)
245
+ @type_class.restrictions.each do |name, value|
246
+ yield name, value
247
+ end
248
+ end
249
+ end
250
+
251
+ def custom?
252
+ true
253
+ end
254
+
255
+ def simple?
256
+ true
257
+ end
258
+ end
259
+
260
+ class Base64 < String # :nodoc:
261
+ end
262
+ end
@@ -0,0 +1,65 @@
1
+ <html>
2
+ <head>
3
+ <title><%= @scaffold_class.wsdl_service_name %> Web Service</title>
4
+ <style>
5
+ body { background-color: #fff; color: #333; }
6
+
7
+ body, p, ol, ul, td {
8
+ font-family: verdana, arial, helvetica, sans-serif;
9
+ font-size: 13px;
10
+ line-height: 18px;
11
+ }
12
+
13
+ pre {
14
+ background-color: #eee;
15
+ padding: 10px;
16
+ font-size: 11px;
17
+ }
18
+
19
+ a { color: #000; }
20
+ a:visited { color: #666; }
21
+ a:hover { color: #fff; background-color:#000; }
22
+
23
+ .fieldWithErrors {
24
+ padding: 2px;
25
+ background-color: red;
26
+ display: table;
27
+ }
28
+
29
+ #errorExplanation {
30
+ width: 400px;
31
+ border: 2px solid red;
32
+ padding: 7px;
33
+ padding-bottom: 12px;
34
+ margin-bottom: 20px;
35
+ background-color: #f0f0f0;
36
+ }
37
+
38
+ #errorExplanation h2 {
39
+ text-align: left;
40
+ font-weight: bold;
41
+ padding: 5px 5px 5px 15px;
42
+ font-size: 12px;
43
+ margin: -7px;
44
+ background-color: #c00;
45
+ color: #fff;
46
+ }
47
+
48
+ #errorExplanation p {
49
+ color: #333;
50
+ margin-bottom: 0;
51
+ padding: 5px;
52
+ }
53
+
54
+ #errorExplanation ul li {
55
+ font-size: 12px;
56
+ list-style: square;
57
+ }
58
+ </style>
59
+ </head>
60
+ <body>
61
+
62
+ <%= @content_for_layout %>
63
+
64
+ </body>
65
+ </html>
@@ -0,0 +1,6 @@
1
+ <% @scaffold_container.services.each do |service| %>
2
+
3
+ <h4>API Methods for <%= service %></h4>
4
+ <%= service_method_list(service) %>
5
+
6
+ <% end %>
@@ -0,0 +1,29 @@
1
+ <h4>Method Invocation Details for <em><%= @scaffold_service %>#<%= @scaffold_method.public_name %></em></h4>
2
+
3
+ <% form_tag(:action => @scaffold_action_name + '_submit') do -%>
4
+ <%= hidden_field_tag "service", @scaffold_service.name %>
5
+ <%= hidden_field_tag "method", @scaffold_method.public_name %>
6
+
7
+ <p>
8
+ <label for="protocol">Protocol:</label><br />
9
+ <%= select_tag 'protocol', options_for_select([['SOAP', 'soap'], ['XML-RPC', 'xmlrpc']], params['protocol']) %>
10
+ </p>
11
+
12
+ <% if @scaffold_method.expects %>
13
+
14
+ <strong>Method Parameters:</strong><br />
15
+ <% @scaffold_method.expects.each_with_index do |type, i| %>
16
+ <p>
17
+ <label for="method_params[<%= i %>]"><%= method_parameter_label(type.name, type) %> </label><br />
18
+ <%= method_parameter_input_fields(@scaffold_method, type, "method_params", i) %>
19
+ </p>
20
+ <% end %>
21
+
22
+ <% end %>
23
+
24
+ <%= submit_tag "Invoke" %>
25
+ <% end -%>
26
+
27
+ <p>
28
+ <%= link_to "Back", :action => @scaffold_action_name %>
29
+ </p>
@@ -0,0 +1,30 @@
1
+ <h4>Method Invocation Result for <em><%= @scaffold_service %>#<%= @scaffold_method.public_name %></em></h4>
2
+
3
+ <p>
4
+ Invocation took <tt><%= '%f' % @method_elapsed %></tt> seconds
5
+ </p>
6
+
7
+ <p>
8
+ <strong>Return Value:</strong><br />
9
+ <pre>
10
+ <%= h @method_return_value.inspect %>
11
+ </pre>
12
+ </p>
13
+
14
+ <p>
15
+ <strong>Request XML:</strong><br />
16
+ <pre>
17
+ <%= h @method_request_xml %>
18
+ </pre>
19
+ </p>
20
+
21
+ <p>
22
+ <strong>Response XML:</strong><br />
23
+ <pre>
24
+ <%= h @method_response_xml %>
25
+ </pre>
26
+ </p>
27
+
28
+ <p>
29
+ <%= link_to "Back", :action => @scaffold_action_name + '_method_params', :method => @scaffold_method.public_name, :service => @scaffold_service.name %>
30
+ </p>
@@ -0,0 +1,111 @@
1
+ # encoding: UTF-8
2
+ require 'test/unit'
3
+
4
+ module Test # :nodoc:
5
+ module Unit # :nodoc:
6
+ class TestCase # :nodoc:
7
+ private
8
+ # invoke the specified API method
9
+ def invoke_direct(method_name, *args)
10
+ prepare_request('api', 'api', method_name, *args)
11
+ @controller.process(@request, @response)
12
+ decode_rpc_response
13
+ end
14
+ alias_method :invoke, :invoke_direct
15
+
16
+ # invoke the specified API method on the specified service
17
+ def invoke_delegated(service_name, method_name, *args)
18
+ prepare_request(service_name.to_s, service_name, method_name, *args)
19
+ @controller.process(@request, @response)
20
+ decode_rpc_response
21
+ end
22
+
23
+ # invoke the specified layered API method on the correct service
24
+ def invoke_layered(service_name, method_name, *args)
25
+ prepare_request('api', service_name, method_name, *args)
26
+ @controller.process(@request, @response)
27
+ decode_rpc_response
28
+ end
29
+
30
+ # ---------------------- internal ---------------------------
31
+
32
+ def prepare_request(action, service_name, api_method_name, *args)
33
+ @request.recycle!
34
+ @request.request_parameters['action'] = action
35
+ @request.env['REQUEST_METHOD'] = 'POST'
36
+ @request.env['HTTP_CONTENT_TYPE'] = 'text/xml'
37
+ @request.env['RAW_POST_DATA'] = encode_rpc_call(service_name, api_method_name, *args)
38
+ case protocol
39
+ when ActionWebService::Protocol::Soap::SoapProtocol
40
+ soap_action = "/#{@controller.controller_name}/#{service_name}/#{public_method_name(service_name, api_method_name)}"
41
+ @request.env['HTTP_SOAPACTION'] = soap_action
42
+ when ActionWebService::Protocol::XmlRpc::XmlRpcProtocol
43
+ @request.env.delete('HTTP_SOAPACTION')
44
+ end
45
+ end
46
+
47
+ def encode_rpc_call(service_name, api_method_name, *args)
48
+ case @controller.web_service_dispatching_mode
49
+ when :direct
50
+ api = @controller.class.web_service_api
51
+ when :delegated, :layered
52
+ api = @controller.web_service_object(service_name.to_sym).class.web_service_api
53
+ end
54
+ protocol.register_api(api)
55
+ method = api.api_methods[api_method_name.to_sym]
56
+ raise ArgumentError, "wrong number of arguments for rpc call (#{args.length} for #{method.expects.length})" if method && method.expects && args.length != method.expects.length
57
+ protocol.encode_request(public_method_name(service_name, api_method_name), args.dup, method.expects)
58
+ end
59
+
60
+ def decode_rpc_response
61
+ public_method_name, return_value = protocol.decode_response(@response.body)
62
+ exception = is_exception?(return_value)
63
+ raise exception if exception
64
+ return_value
65
+ end
66
+
67
+ def public_method_name(service_name, api_method_name)
68
+ public_name = service_api(service_name).public_api_method_name(api_method_name)
69
+ if @controller.web_service_dispatching_mode == :layered && protocol.is_a?(ActionWebService::Protocol::XmlRpc::XmlRpcProtocol)
70
+ '%s.%s' % [service_name.to_s, public_name]
71
+ else
72
+ public_name
73
+ end
74
+ end
75
+
76
+ def service_api(service_name)
77
+ case @controller.web_service_dispatching_mode
78
+ when :direct
79
+ @controller.class.web_service_api
80
+ when :delegated, :layered
81
+ @controller.web_service_object(service_name.to_sym).class.web_service_api
82
+ end
83
+ end
84
+
85
+ def protocol
86
+ if @protocol.nil?
87
+ @protocol ||= ActionWebService::Protocol::Soap::SoapProtocol.create(@controller)
88
+ else
89
+ case @protocol
90
+ when :xmlrpc
91
+ @protocol = ActionWebService::Protocol::XmlRpc::XmlRpcProtocol.create(@controller)
92
+ when :soap
93
+ @protocol = ActionWebService::Protocol::Soap::SoapProtocol.create(@controller)
94
+ else
95
+ @protocol
96
+ end
97
+ end
98
+ end
99
+
100
+ def is_exception?(obj)
101
+ case protocol
102
+ when :soap, ActionWebService::Protocol::Soap::SoapProtocol
103
+ (obj.respond_to?(:detail) && obj.detail.respond_to?(:cause) && \
104
+ obj.detail.cause.is_a?(Exception)) ? obj.detail.cause : nil
105
+ when :xmlrpc, ActionWebService::Protocol::XmlRpc::XmlRpcProtocol
106
+ obj.is_a?(XMLRPC::FaultException) ? obj : nil
107
+ end
108
+ end
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,10 @@
1
+ # encoding: UTF-8
2
+ module ActionWebService
3
+ module VERSION #:nodoc:
4
+ MAJOR = 2
5
+ MINOR = 3
6
+ TINY = 5
7
+
8
+ STRING = [MAJOR, MINOR, TINY].join('.')
9
+ end
10
+ end
@@ -0,0 +1,61 @@
1
+ # encoding: UTF-8
2
+ #--
3
+ # Copyright (C) 2005 Leon Breedt
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining
6
+ # a copy of this software and associated documentation files (the
7
+ # "Software"), to deal in the Software without restriction, including
8
+ # without limitation the rights to use, copy, modify, merge, publish,
9
+ # distribute, sublicense, and/or sell copies of the Software, and to
10
+ # permit persons to whom the Software is furnished to do so, subject to
11
+ # the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be
14
+ # included in all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+ #++
24
+
25
+ begin
26
+ require 'active_support'
27
+ require 'action_controller'
28
+ require 'active_record'
29
+ rescue LoadError
30
+ require 'rubygems'
31
+ gem 'activesupport'
32
+ gem 'actionpack'
33
+ gem 'activerecord'
34
+ end
35
+
36
+ $:.unshift(File.dirname(__FILE__) + "/action_web_service/vendor/")
37
+
38
+ require 'action_web_service/string_to_datetime_for_soap'
39
+ require 'action_web_service/support/class_inheritable_options'
40
+ require 'action_web_service/support/signature_types'
41
+ require 'action_web_service/base'
42
+ require 'action_web_service/client'
43
+ require 'action_web_service/invocation'
44
+ require 'action_web_service/api'
45
+ require 'action_web_service/casting'
46
+ require 'action_web_service/simple'
47
+ require 'action_web_service/struct'
48
+ require 'action_web_service/container'
49
+ require 'action_web_service/protocol'
50
+ require 'action_web_service/dispatcher'
51
+ require 'action_web_service/scaffolding'
52
+ require 'action_web_service/acts_as_web_service'
53
+
54
+ ActionWebService::Base.class_eval do
55
+ include ActionWebService::Container::Direct
56
+ include ActionWebService::Invocation
57
+ end
58
+
59
+ ActionController::Base.class_eval do
60
+ include ActionWebService::ActsAsWebService
61
+ end
@@ -0,0 +1,2 @@
1
+ # encoding: UTF-8
2
+ require 'action_web_service'