Module: WashOut::SOAP::ClassMethods
- Defined in:
- lib/wash_out/soap.rb
Instance Attribute Summary collapse
-
#soap_actions ⇒ Object
Returns the value of attribute soap_actions.
Instance Method Summary collapse
-
#soap_action(action, options = {}) ⇒ Object
Define a SOAP action
action
.
Instance Attribute Details
#soap_actions ⇒ Object
Returns the value of attribute soap_actions.
8 9 10 |
# File 'lib/wash_out/soap.rb', line 8 def soap_actions @soap_actions end |
Instance Method Details
#soap_action(action, options = {}) ⇒ Object
Define a SOAP action action
. The function has two required options
: :args and :return. Each is a type definition
of format described in WashOut::Param#parse_def.
An optional option :to can be passed to allow for names of SOAP actions which are not valid Ruby function names. There is also an optional :header_return option to specify the format of the SOAP response’s header tag (<env:Header></env:Header>). If unspecified, there will be no header tag in the response.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/wash_out/soap.rb', line 19 def soap_action(action, ={}) if [:as].present? [:to] ||= action action = [:as] end if action.is_a?(Symbol) if soap_config.camelize_wsdl.to_s == 'lower' [:to] ||= action.to_s action = action.to_s.camelize(:lower) elsif soap_config.camelize_wsdl [:to] ||= action.to_s action = action.to_s.camelize end end default_response_tag = soap_config.camelize_wsdl ? 'Response' : '_response' default_response_tag = action+default_response_tag self.soap_actions[action] = .merge( :in => WashOut::Param.parse_def(soap_config, [:args]), :request_tag => [:as] || action, :out => WashOut::Param.parse_def(soap_config, [:return]), :header_out => [:header_return].present? ? WashOut::Param.parse_def(soap_config, [:header_return]) : nil, :to => [:to] || action, :response_tag => [:response_tag] || default_response_tag ) end |