Class: Stockboy::Providers::SOAP
- Inherits:
-
Stockboy::Provider
- Object
- Stockboy::Provider
- Stockboy::Providers::SOAP
- Defined in:
- lib/stockboy/providers/soap.rb
Overview
Fetch data from a SOAP endpoint
Backed by Savon gem, see savon for full configuration options: extra options are passed through.
Options collapse
-
#endpoint ⇒ Object
Optional if specified in WSDL.
-
#headers ⇒ Hash
Hash of optional HTTP request headers.
-
#message ⇒ Hash
Hash of message options passed in the request, often includes credentials and query options.
-
#message_tag ⇒ String
Message tag name.
-
#namespace ⇒ Object
Optional if specified in WSDL.
-
#namespace_id ⇒ Object
Optional if specified in WSDL.
-
#namespaces ⇒ Object
Optional if specified in WSDL.
-
#open_timeout ⇒ Integer
Maximum time to establish a connection.
-
#read_timeout ⇒ Integer
Maximum time to read data from connection.
-
#request ⇒ String
The name of the request, see your SOAP documentation.
-
#response_format ⇒ Symbol
Change the default response type, default :hash.
-
#soap_header ⇒ String
XML string to override the Soap headers.
-
#wsdl ⇒ String
URL with the WSDL document.
-
#wsse_auth ⇒ Array
Array of WSSE Auth values.
Attributes inherited from Stockboy::Provider
#data, #data_size, #data_time, #errors, #logger
Options collapse
Instance Method Summary collapse
-
#client {|@client| ... } ⇒ Savon::Client
Connection object to the configured SOAP endpoint.
-
#initialize(opts = {}, &block) ⇒ SOAP
constructor
Initialize a new SOAP provider.
Methods inherited from Stockboy::Provider
#clear, #data?, #inspect, #reload, #valid?
Constructor Details
#initialize(opts = {}, &block) ⇒ SOAP
Initialize a new SOAP provider
156 157 158 159 160 |
# File 'lib/stockboy/providers/soap.rb', line 156 def initialize(opts={}, &block) super @response_format = opts[:response_format] || :hash DSL.new(self).instance_eval(&block) if block_given? end |
Instance Attribute Details
#endpoint ⇒ Object
Optional if specified in WSDL
83 |
# File 'lib/stockboy/providers/soap.rb', line 83 dsl_attr :endpoint |
#headers ⇒ Hash
Hash of optional HTTP request headers
141 |
# File 'lib/stockboy/providers/soap.rb', line 141 dsl_attr :headers |
#message ⇒ Hash
Hash of message options passed in the request, often includes credentials and query options.
93 |
# File 'lib/stockboy/providers/soap.rb', line 93 dsl_attr :message |
#message_tag ⇒ String
Message tag name
102 |
# File 'lib/stockboy/providers/soap.rb', line 102 dsl_attr :message_tag |
#namespace ⇒ Object
Optional if specified in WSDL
65 |
# File 'lib/stockboy/providers/soap.rb', line 65 dsl_attr :namespace |
#namespace_id ⇒ Object
Optional if specified in WSDL
77 |
# File 'lib/stockboy/providers/soap.rb', line 77 dsl_attr :namespace_id |
#namespaces ⇒ Object
Optional if specified in WSDL
71 |
# File 'lib/stockboy/providers/soap.rb', line 71 dsl_attr :namespaces |
#open_timeout ⇒ Integer
Maximum time to establish a connection
35 |
# File 'lib/stockboy/providers/soap.rb', line 35 dsl_attr :open_timeout |
#read_timeout ⇒ Integer
Maximum time to read data from connection
44 |
# File 'lib/stockboy/providers/soap.rb', line 44 dsl_attr :read_timeout |
#request ⇒ String
The name of the request, see your SOAP documentation
53 |
# File 'lib/stockboy/providers/soap.rb', line 53 dsl_attr :request |
#response_format ⇒ Symbol
Change the default response type, default :hash
132 |
# File 'lib/stockboy/providers/soap.rb', line 132 dsl_attr :response_format |
#soap_header ⇒ String
XML string to override the Soap headers
117 |
# File 'lib/stockboy/providers/soap.rb', line 117 dsl_attr :soap_header |
#wsdl ⇒ String
URL with the WSDL document
26 |
# File 'lib/stockboy/providers/soap.rb', line 26 dsl_attr :wsdl |
#wsse_auth ⇒ Array
Array of WSSE Auth values
150 |
# File 'lib/stockboy/providers/soap.rb', line 150 dsl_attr :wsse_auth |
Instance Method Details
#attributes ⇒ Hash
123 |
# File 'lib/stockboy/providers/soap.rb', line 123 dsl_attr :attributes |
#client {|@client| ... } ⇒ Savon::Client
Connection object to the configured SOAP endpoint
166 167 168 169 170 171 172 |
# File 'lib/stockboy/providers/soap.rb', line 166 def client @client ||= Savon.client() @client.globals.open_timeout(open_timeout) if open_timeout @client.globals.read_timeout(read_timeout) if read_timeout yield @client if block_given? @client end |
#env_namespace ⇒ Symbol
59 |
# File 'lib/stockboy/providers/soap.rb', line 59 dsl_attr :env_namespace |
#soap_action ⇒ String
108 |
# File 'lib/stockboy/providers/soap.rb', line 108 dsl_attr :soap_action |