Class: Savon::Client

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

Overview

Savon::Client

Heavy metal Ruby SOAP client library. Minimizes the overhead of working with SOAP services and XML.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint) ⇒ Client

Expects a SOAP endpoint String.



10
11
12
13
# File 'lib/savon/client.rb', line 10

def initialize(endpoint)
  @request = Request.new endpoint
  @wsdl = WSDL.new @request
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)

Dispatches requests to SOAP actions matching a given method name.



27
28
29
30
31
32
# File 'lib/savon/client.rb', line 27

def method_missing(method, *args, &block) #:doc:
  super unless @wsdl.respond_to? method

  setup method, &block
  dispatch method
end

Instance Attribute Details

#wsdlObject (readonly)

Returns the Savon::WSDL.



16
17
18
# File 'lib/savon/client.rb', line 16

def wsdl
  @wsdl
end

Instance Method Details

#respond_to?(method) ⇒ Boolean

Returns true for available methods and SOAP actions.

Returns:

  • (Boolean)


19
20
21
22
# File 'lib/savon/client.rb', line 19

def respond_to?(method)
  return true if @wsdl.respond_to? method
  super
end