1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionwebservice/lib/action_web_service/protocol/discovery.rb
Leon Breedt 100015cd80 Make all custom types and method calls are declared in the 'urn:ActionWebService'
namespace as a default, fixes SOAP marshaling for .NET, a regression since the merge.

Make array annotation be recursive in WS::Marshaling::SoapMarshaling, this makes
typed arrays buried in nested structures still be annotated correctly.

Support :layered dispatching mode for XML-RPC namespaced method names.

Change WS::ParamInfo.create signature to require type_binding, and update all
uses of this.

Restore #default_api_method functionality, fixes a regression since the merge.

Fix marshalling of ActiveRecord::Base derivatives, fixes a regression since the merge.

This changeset closes #676, #677, and #678.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@811 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-27 21:21:40 +00:00

37 lines
1.2 KiB
Ruby

module ActionWebService # :nodoc:
module Protocol # :nodoc:
module Discovery # :nodoc:
def self.included(base)
base.extend(ClassMethods)
base.send(:include, ActionWebService::Protocol::Discovery::InstanceMethods)
end
module ClassMethods # :nodoc:
def register_protocol(klass)
write_inheritable_array("web_service_protocols", [klass])
end
end
module InstanceMethods # :nodoc:
private
def discover_web_service_request(ap_request)
(self.class.read_inheritable_attribute("web_service_protocols") || []).each do |protocol|
protocol = protocol.new
request = protocol.unmarshal_request(ap_request)
return request unless request.nil?
end
nil
end
def create_web_service_client(api, protocol_name, endpoint_uri, options)
(self.class.read_inheritable_attribute("web_service_protocols") || []).each do |protocol|
protocol = protocol.new
client = protocol.protocol_client(api, protocol_name, endpoint_uri, options)
return client unless client.nil?
end
nil
end
end
end
end
end