class Savon::LocalOptions
Public Class Methods
Savon::Options::new
# File lib/savon/options.rb, line 386 def initialize(options = {}) @option_type = :local defaults = { :advanced_typecasting => true, :response_parser => :nokogiri, :multipart => false } super defaults.merge(options) end
Public Instance Methods
Instruct Nori to use advanced typecasting.
# File lib/savon/options.rb, line 471 def advanced_typecasting(advanced) @options[:advanced_typecasting] = advanced end
Attachments for the SOAP message (www.w3.org/TR/SOAP-attachments)
should pass an Array or a Hash; items should be path strings or
{ filename: 'file.name', content: 'content' } objects
The Content-ID in multipart message sections will be the filename or the key if Hash is given
usage examples:
response = client.call :operation1 do message param1: 'value' attachments [ { filename: 'x1.xml', content: '<xml>abc</xml>'}, { filename: 'x2.xml', content: '<xml>abc</xml>'} ] end # Content-ID will be x1.xml and x2.xml response = client.call :operation1 do message param1: 'value' attachments 'x1.xml' => '/tmp/1281ab7d7d.xml', 'x2.xml' => '/tmp/4c5v8e833a.xml' end # Content-ID will be x1.xml and x2.xml response = client.call :operation1 do message param1: 'value' attachments [ '/tmp/1281ab7d7d.xml', '/tmp/4c5v8e833a.xml'] end # Content-ID will be 1281ab7d7d.xml and 4c5v8e833a.xml
The Content-ID is important if you want to refer to the attachments from the SOAP request
# File lib/savon/options.rb, line 451 def attachments(attachments) @options[:attachments] = attachments end
Attributes for the SOAP message tag.
# File lib/savon/options.rb, line 417 def attributes(attributes) @options[:attributes] = attributes end
# File lib/savon/options.rb, line 485 def headers(headers) @options[:headers] = headers end
The SOAP message to send. Expected to be a Hash or a String.
# File lib/savon/options.rb, line 406 def message(message) @options[:message] = message end
SOAP message tag (formerly known as SOAP input tag). If it’s not set, Savon
retrieves the name from the WSDL document (if available). Otherwise, Gyoku converts the operation name into an XML element.
# File lib/savon/options.rb, line 412 def message_tag(message_tag) @options[:message_tag] = message_tag end
Instruct Savon
to create a multipart response if available.
# File lib/savon/options.rb, line 481 def multipart(multipart) @options[:multipart] = multipart end
Instruct Nori to use :rexml or :nokogiri to parse the response.
# File lib/savon/options.rb, line 476 def response_parser(parser) @options[:response_parser] = parser end
Value of the SOAPAction HTTP header.
# File lib/savon/options.rb, line 456 def soap_action(soap_action) @options[:soap_action] = soap_action end
The local SOAP header. Expected to be a Hash or respond to to_s. Will be merged with the global SOAP header if both are Hashes. Otherwise the local option will be prefered.
# File lib/savon/options.rb, line 401 def soap_header(header) @options[:soap_header] = header end
The SOAP request XML to send. Expected to be a String.
# File lib/savon/options.rb, line 466 def xml(xml) @options[:xml] = xml end