Class: Savon::WSDL::Document
- Inherits:
-
Object
- Object
- Savon::WSDL::Document
- Defined in:
- lib/savon/wsdl/document.rb
Overview
Savon::WSDL::Document
Represents the WSDL of your service, including information like the namespace URI, the SOAP endpoint and available SOAP actions.
Instance Attribute Summary collapse
-
#document ⇒ Object
(also: #to_xml)
Returns the raw WSDL document.
-
#endpoint ⇒ Object
Returns the SOAP endpoint.
-
#namespace ⇒ Object
Returns the namespace URI of the WSDL.
-
#request ⇒ Object
Accessor for the
HTTPI::Request
to use.
Instance Method Summary collapse
-
#element_form_default ⇒ Object
Returns the elementFormDefault value.
-
#initialize(request = nil, document = nil) ⇒ Document
constructor
Accepts an
HTTPI::Request
and adocument
. -
#operations ⇒ Object
Returns a Hash of SOAP operations.
- #present? ⇒ Boolean
-
#soap_action(key) ⇒ Object
Returns the SOAP action for a given
key
. -
#soap_actions ⇒ Object
Returns an Array of available SOAP actions.
-
#soap_input(key) ⇒ Object
Returns the SOAP input for a given
key
.
Constructor Details
#initialize(request = nil, document = nil) ⇒ Document
Accepts an HTTPI::Request
and a document
.
16 17 18 19 |
# File 'lib/savon/wsdl/document.rb', line 16 def initialize(request = nil, document = nil) self.request = request self.document = document end |
Instance Attribute Details
#document ⇒ Object Also known as: to_xml
Returns the raw WSDL document.
74 75 76 77 78 79 |
# File 'lib/savon/wsdl/document.rb', line 74 def document @wsdl_document ||= begin raise ArgumentError, "No WSDL document given" if @document.blank? remote? ? http_request : read_file end end |
#endpoint ⇒ Object
Returns the SOAP endpoint.
37 38 39 |
# File 'lib/savon/wsdl/document.rb', line 37 def endpoint @endpoint ||= parser.endpoint end |
#namespace ⇒ Object
Returns the namespace URI of the WSDL.
29 30 31 |
# File 'lib/savon/wsdl/document.rb', line 29 def namespace @namespace ||= parser.namespace end |
#request ⇒ Object
Accessor for the HTTPI::Request
to use.
22 23 24 |
# File 'lib/savon/wsdl/document.rb', line 22 def request @request end |
Instance Method Details
#element_form_default ⇒ Object
Returns the elementFormDefault value.
65 66 67 |
# File 'lib/savon/wsdl/document.rb', line 65 def element_form_default @element_form_default ||= parser.element_form_default end |
#operations ⇒ Object
Returns a Hash of SOAP operations.
60 61 62 |
# File 'lib/savon/wsdl/document.rb', line 60 def operations @operations ||= parser.operations end |
#present? ⇒ Boolean
24 25 26 |
# File 'lib/savon/wsdl/document.rb', line 24 def present? !!@document end |
#soap_action(key) ⇒ Object
Returns the SOAP action for a given key
.
50 51 52 |
# File 'lib/savon/wsdl/document.rb', line 50 def soap_action(key) operations[key][:action] if present? && operations[key] end |
#soap_actions ⇒ Object
Returns an Array of available SOAP actions.
45 46 47 |
# File 'lib/savon/wsdl/document.rb', line 45 def soap_actions @soap_actions ||= parser.operations.keys end |
#soap_input(key) ⇒ Object
Returns the SOAP input for a given key
.
55 56 57 |
# File 'lib/savon/wsdl/document.rb', line 55 def soap_input(key) operations[key][:input].to_sym if present? && operations[key] end |