aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/lib
diff options
context:
space:
mode:
authorLeon Breedt <bitserf@gmail.com>2005-03-03 21:30:44 +0000
committerLeon Breedt <bitserf@gmail.com>2005-03-03 21:30:44 +0000
commite834be75bcbbece8970abad221f21411c5b93a96 (patch)
tree4e8ec07daa10cb8ce38432cf971627a4330868ee /actionwebservice/lib
parent631340d5d1b6c3bc610960116226789c4f51eecc (diff)
downloadrails-e834be75bcbbece8970abad221f21411c5b93a96.tar.gz
rails-e834be75bcbbece8970abad221f21411c5b93a96.tar.bz2
rails-e834be75bcbbece8970abad221f21411c5b93a96.zip
allow the client to specify options to be passed through to the underlying
SOAP::RPC::Driver. add to RDoc an example of using these options to configure SSL client-certificate authenticated connections to the server. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@826 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/lib')
-rw-r--r--actionwebservice/lib/action_web_service/client/soap_client.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/actionwebservice/lib/action_web_service/client/soap_client.rb b/actionwebservice/lib/action_web_service/client/soap_client.rb
index d3975d89a2..b8a20bb40e 100644
--- a/actionwebservice/lib/action_web_service/client/soap_client.rb
+++ b/actionwebservice/lib/action_web_service/client/soap_client.rb
@@ -28,15 +28,32 @@ module ActionWebService # :nodoc:
# declare its custom types, you can specify it here
# [<tt>:method_namespace</tt>] If the remote server has used a custom namespace to
# declare its methods, you can specify it here
+ # [<tt>:driver_options</tt>] If you want to supply any custom SOAP RPC driver
+ # options, you can provide them as a Hash here
+ #
+ # The <tt>:driver_options</tt> option can be used to configure the backend SOAP
+ # RPC driver. An example of configuring the SOAP backend to do
+ # client-certificate authenticated SSL connections to the server:
+ #
+ # opts = {}
+ # opts['protocol.http.ssl_config.verify_mode'] = 'OpenSSL::SSL::VERIFY_PEER'
+ # opts['protocol.http.ssl_config.client_cert'] = client_cert_file_path
+ # opts['protocol.http.ssl_config.client_key'] = client_key_file_path
+ # opts['protocol.http.ssl_config.ca_file'] = ca_cert_file_path
+ # client = ActionWebService::Client::Soap.new(api, 'https://some/service', :driver_options => opts)
def initialize(api, endpoint_uri, options={})
super(api, endpoint_uri)
@type_namespace = options[:type_namespace] || 'urn:ActionWebService'
@method_namespace = options[:method_namespace] || 'urn:ActionWebService'
+ @driver_options = options[:driver_options] || {}
@marshaler = WS::Marshaling::SoapMarshaler.new @type_namespace
@encoder = WS::Encoding::SoapRpcEncoding.new @method_namespace
@soap_action_base = options[:soap_action_base]
@soap_action_base ||= URI.parse(endpoint_uri).path
@driver = create_soap_rpc_driver(api, endpoint_uri)
+ @driver_options.each do |name, value|
+ @driver.options[name.to_s] = value.to_s
+ end
end
protected