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 = request
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.nil? ? true : @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

#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 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.



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

def to_s
  # TODO: this class fails completely when the URL for the WSDL redirects
  @document ||= @request.wsdl.body
end