diff options
Diffstat (limited to 'actionservice/lib/action_service/router')
-rw-r--r-- | actionservice/lib/action_service/router/action_controller.rb | 30 | ||||
-rw-r--r-- | actionservice/lib/action_service/router/wsdl.rb | 6 |
2 files changed, 19 insertions, 17 deletions
diff --git a/actionservice/lib/action_service/router/action_controller.rb b/actionservice/lib/action_service/router/action_controller.rb index 01bd298bce..ca9c94e35c 100644 --- a/actionservice/lib/action_service/router/action_controller.rb +++ b/actionservice/lib/action_service/router/action_controller.rb @@ -2,8 +2,8 @@ module ActionService # :nodoc: module Router # :nodoc: module ActionController # :nodoc: def self.append_features(base) # :nodoc: - base.add_service_api_callback do |container_class, api| - if container_class.service_dispatching_mode == :direct && !container_class.method_defined?(:api) + base.add_web_service_api_callback do |container_class, api| + if container_class.web_service_dispatching_mode == :direct container_class.class_eval <<-EOS def api process_action_service_request @@ -11,8 +11,8 @@ module ActionService # :nodoc: EOS end end - base.add_service_definition_callback do |klass, name, info| - if klass.service_dispatching_mode == :delegated + base.add_web_service_definition_callback do |klass, name, info| + if klass.web_service_dispatching_mode == :delegated klass.class_eval <<-EOS def #{name} process_action_service_request @@ -31,13 +31,15 @@ module ActionService # :nodoc: begin protocol_request = probe_request_protocol(self.request) rescue Exception => e - logger.error "Invalid request: #{e.message}" - logger.error self.request.raw_post + unless logger.nil? + logger.error "Invalid request: #{e.message}" + logger.error self.request.raw_post + end raise end if protocol_request log_request(protocol_request) - protocol_response = dispatch_service_request(protocol_request) + protocol_response = dispatch_web_service_request(protocol_request) log_response(protocol_response) response_options = { :type => protocol_response.content_type, @@ -45,20 +47,20 @@ module ActionService # :nodoc: } send_data(protocol_response.raw_body, response_options) else - logger.fatal "Invalid Action Service service or method requested" + logger.fatal "Invalid Action Service service or method requested" unless logger.nil? render_text 'Internal protocol error', "500 Invalid service/method" end rescue Exception => e log_error e unless logger.nil? exc_response = nil - case service_dispatching_mode + case web_service_dispatching_mode when :direct - if self.class.service_exception_reporting + if self.class.web_service_exception_reporting exc_response = protocol_request.protocol.marshal_exception(e) end when :delegated - service_object = service_object(protocol_request.service_name) rescue nil - if service_object && service_object.class.service_exception_reporting + web_service = web_service_object(protocol_request.service_name) rescue nil + if web_service && web_service.class.web_service_exception_reporting exc_response = protocol_request.protocol.marshal_exception(e) rescue nil end end @@ -77,9 +79,9 @@ module ActionService # :nodoc: def log_request(protocol_request) unless logger.nil? - service_name = protocol_request.service_name + web_service_name = protocol_request.web_service_name method_name = protocol_request.public_method_name - logger.info "\nProcessing Action Service Request: #{service_name}##{method_name}" + logger.info "\nProcessing Action Service Request: #{web_service_name}##{method_name}" logger.info "Raw Request Body:" logger.info protocol_request.raw_body end diff --git a/actionservice/lib/action_service/router/wsdl.rb b/actionservice/lib/action_service/router/wsdl.rb index ececa63322..c2f29da0b0 100644 --- a/actionservice/lib/action_service/router/wsdl.rb +++ b/actionservice/lib/action_service/router/wsdl.rb @@ -46,7 +46,7 @@ module ActionService # :nodoc: def to_wsdl(container, uri, soap_action_base) wsdl = "" - service_dispatching_mode = container.service_dispatching_mode + web_service_dispatching_mode = container.web_service_dispatching_mode mapper = container.class.soap_mapper namespace = mapper.custom_namespace wsdl_service_name = namespace.split(/:/)[1] @@ -152,7 +152,7 @@ module ActionService # :nodoc: api_methods.each do |method_name, method_signature| public_name = service_api.public_api_method_name(method_name) xm.operation('name' => public_name) do - case service_dispatching_mode + case web_service_dispatching_mode when :direct soap_action = soap_action_base + "/api/" + public_name when :delegated @@ -183,7 +183,7 @@ module ActionService # :nodoc: services.each do |service_name, service_values| port_name = port_name_for(wsdl_service_name, service_name) binding_name = binding_name_for(wsdl_service_name, service_name) - case service_dispatching_mode + case web_service_dispatching_mode when :direct binding_target = 'api' when :delegated |