Module: SoapObject::ClassMethods
- Defined in:
- lib/soap-object/class_methods.rb
Instance Method Summary collapse
-
#basic_auth(*name_password) ⇒ Object
Use basic authentication for all requests.
-
#digest_auth(*name_password) ⇒ Object
Use digest authentiation for all requests.
-
#encoding(enc) ⇒ Object
Set the encoding for the message.
-
#endpoint(url) ⇒ Object
Override the endpoint binding in the WSDL.
-
#log_level(level) ⇒ Object
Set the log level used for logging.
-
#open_timeout(timeout) ⇒ Object
Sets the open timeout for retrieving the wsdl and making remote requests.
-
#proxy(url) ⇒ Object
Set a proxy server to be used.
-
#read_timeout(timeout) ⇒ Object
Sets the read timeout for retrieving the wsdl and reading the results of remote requests.
-
#soap_header(hsh) ⇒ Object
Add custom XML to the soap header.
- #soap_version(version) ⇒ Object
-
#ssl_options(&block) ⇒ Object
Set the ssl options.
-
#wsdl(url) ⇒ Object
Sets the url for the wsdl.
Instance Method Details
#basic_auth(*name_password) ⇒ Object
Use basic authentication for all requests
95 96 97 98 99 |
# File 'lib/soap-object/class_methods.rb', line 95 def basic_auth(*name_password) define_method(:with_basic_auth) do {basic_auth: name_password} end end |
#digest_auth(*name_password) ⇒ Object
Use digest authentiation for all requests
106 107 108 109 110 |
# File 'lib/soap-object/class_methods.rb', line 106 def digest_auth(*name_password) define_method(:with_digest_auth) do {digest_auth: name_password} end end |
#encoding(enc) ⇒ Object
Set the encoding for the message
84 85 86 87 88 |
# File 'lib/soap-object/class_methods.rb', line 84 def encoding(enc) define_method(:with_encoding) do {encoding: enc} end end |
#endpoint(url) ⇒ Object
Override the endpoint binding in the WSDL
24 25 26 27 28 |
# File 'lib/soap-object/class_methods.rb', line 24 def endpoint(url) define_method(:with_endpoint) do {endpoint: url} end end |
#log_level(level) ⇒ Object
Set the log level used for logging
- Symbol
-
valid values are :info, :debug, :warn, :error, and :fatal
117 118 119 120 121 |
# File 'lib/soap-object/class_methods.rb', line 117 def log_level(level) define_method(:with_log_level) do {log: true, log_level: level, pretty_print_xml: true} end end |
#open_timeout(timeout) ⇒ Object
Sets the open timeout for retrieving the wsdl and making remote requests.
49 50 51 52 53 |
# File 'lib/soap-object/class_methods.rb', line 49 def open_timeout(timeout) define_method(:with_open_timeout) do {open_timeout: timeout} end end |
#proxy(url) ⇒ Object
Set a proxy server to be used. This will be used for retrieving the wsdl as well as making the remote requests.
37 38 39 40 41 |
# File 'lib/soap-object/class_methods.rb', line 37 def proxy(url) define_method(:with_proxy) do {proxy: url} end end |
#read_timeout(timeout) ⇒ Object
Sets the read timeout for retrieving the wsdl and reading the results of remote requests.
61 62 63 64 65 |
# File 'lib/soap-object/class_methods.rb', line 61 def read_timeout(timeout) define_method(:with_read_timeout) do {read_timeout: timeout} end end |
#soap_header(hsh) ⇒ Object
Add custom XML to the soap header.
header
73 74 75 76 77 |
# File 'lib/soap-object/class_methods.rb', line 73 def soap_header(hsh) define_method(:with_soap_header) do {soap_header: hsh} end end |
#soap_version(version) ⇒ Object
136 137 138 139 140 |
# File 'lib/soap-object/class_methods.rb', line 136 def soap_version(version) define_method(:with_soap_version) do {soap_version: version} end end |
#ssl_options(&block) ⇒ Object
Set the ssl options
128 129 130 131 132 133 134 |
# File 'lib/soap-object/class_methods.rb', line 128 def (&block) ssl = SslOptions.new(&block) define_method(:with_ssl_options) do ssl. end end |
#wsdl(url) ⇒ Object
Sets the url for the wsdl. It can be a path to a local file or a url to a remote server containing the file.
the wsdl to use for all requests.
12 13 14 15 16 17 |
# File 'lib/soap-object/class_methods.rb', line 12 def wsdl(url) define_method(:with_wsdl) do @wsdl ||= url {wsdl: @wsdl} end end |