rails/actionwebservice/lib/action_web_service/base.rb
Leon Breedt 6f5a7b2004 merged the changes for the upcoming 0.6.0:
seperate out protocol marshaling into a small 'ws' library in vendor, so that
AWS itself only does integration with ActionPack, and so we can keep protocol
specific code in AWS proper to a minimum. refactor unit tests to get 95%
code coverage (for a baseline).

be far more relaxed about the types given to us by the remote side, don't do
any poor man's type checking, just try to cast and marshal to the correct types if
possible, and if not, return what they gave us anyway. this should make interoperating
with fuzzy XML-RPC clients easier.

if exception reporting is turned on, do best-effort error responses, so that
we can avoid "Internal protocol error" with no details if there is a bug in
AWS itself.

also perform extensive cleanups on AWS proper.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@800 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-25 23:39:39 +00:00

39 lines
1.1 KiB
Ruby

module ActionWebService # :nodoc:
class ActionWebServiceError < StandardError # :nodoc:
end
# An Action Web Service object implements a specified API.
#
# Used by controllers operating in _Delegated_ dispatching mode.
#
# ==== Example
#
# class PersonService < ActionWebService::Base
# web_service_api PersonAPI
#
# def find_person(criteria)
# Person.find_all [...]
# end
#
# def delete_person(id)
# Person.find_by_id(id).destroy
# end
# end
#
# class PersonAPI < ActionWebService::API::Base
# api_method :find_person, :expects => [SearchCriteria], :returns => [[Person]]
# api_method :delete_person, :expects => [:int]
# end
#
# class SearchCriteria < ActionStruct::Base
# member :firstname, :string
# member :lastname, :string
# member :email, :string
# end
class Base
# Whether to report exceptions back to the caller in the protocol's exception
# format
class_inheritable_option :web_service_exception_reporting, true
end
end