Class: Savon::WSDL

Inherits:
Object show all
Defined in:
lib/savon/wsdl.rb

Overview

Savon::WSDL

Represents the WSDL document.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ WSDL

Initializer, expects a Savon::Request.



9
10
11
# File 'lib/savon/wsdl.rb', line 9

def initialize(request)
  @request, @enabled = request, true
end

Instance Attribute Details

#enabled=(value) ⇒ Object (writeonly)

Sets whether to use the WSDL.



14
15
16
# File 'lib/savon/wsdl.rb', line 14

def enabled=(value)
  @enabled = value
end

Instance Method Details

#enabled?Boolean

Returns whether to use the WSDL. Defaults to true.

Returns:

  • (Boolean)


17
18
19
# File 'lib/savon/wsdl.rb', line 17

def enabled?
  @enabled
end

#namespace_uriObject

Returns the namespace URI of the WSDL.



22
23
24
# File 'lib/savon/wsdl.rb', line 22

def namespace_uri
  @namespace_uri ||= stream.namespace_uri
end

#operation_from(soap_action) ⇒ Object

Returns a SOAP operation Hash containing the SOAP action and input for a given soap_call.



50
51
52
53
# File 'lib/savon/wsdl.rb', line 50

def operation_from(soap_action)
  return operations[soap_action] if enabled?
  { :action => soap_action.to_soap_key, :input => soap_action.to_soap_key }
end

#operationsObject

Returns a Hash of SOAP operations including their corresponding SOAP actions and inputs.



33
34
35
# File 'lib/savon/wsdl.rb', line 33

def operations
  @operations ||= stream.operations
end

#respond_to?(method) ⇒ Boolean

Returns true for available methods and SOAP actions.

Returns:

  • (Boolean)


43
44
45
46
# File 'lib/savon/wsdl.rb', line 43

def respond_to?(method)
  return true if !enabled? || soap_actions.include?(method)
  super
end

#soap_actionsObject

Returns an Array of available SOAP actions.



27
28
29
# File 'lib/savon/wsdl.rb', line 27

def soap_actions
  @soap_actions ||= stream.operations.keys
end

#soap_endpointObject

Returns the SOAP endpoint.



38
39
40
# File 'lib/savon/wsdl.rb', line 38

def soap_endpoint
  @soap_endpoint ||= stream.soap_endpoint
end

#to_sObject

Returns the raw WSDL document.



56
57
58
# File 'lib/savon/wsdl.rb', line 56

def to_s
  @document ||= @request.wsdl.body
end