GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
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
Leon Breedt (author)
Thu Mar 03 13:30:44 -0800 2005
commit  e834be75bcbbece8970abad221f21411c5b93a96
tree    4e8ec07daa10cb8ce38432cf971627a4330868ee
parent  631340d5d1b6c3bc610960116226789c4f51eecc
...
28
29
30
 
 
 
 
 
 
 
 
 
 
 
 
 
31
32
33
34
 
35
36
37
38
39
 
 
 
40
41
42
...
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
0
@@ -28,15 +28,32 @@ module ActionWebService # :nodoc:
0
       # declare its custom types, you can specify it here
0
       # [<tt>:method_namespace</tt>] If the remote server has used a custom namespace to
0
       # declare its methods, you can specify it here
0
+ # [<tt>:driver_options</tt>] If you want to supply any custom SOAP RPC driver
0
+ # options, you can provide them as a Hash here
0
+ #
0
+ # The <tt>:driver_options</tt> option can be used to configure the backend SOAP
0
+ # RPC driver. An example of configuring the SOAP backend to do
0
+ # client-certificate authenticated SSL connections to the server:
0
+ #
0
+ # opts = {}
0
+ # opts['protocol.http.ssl_config.verify_mode'] = 'OpenSSL::SSL::VERIFY_PEER'
0
+ # opts['protocol.http.ssl_config.client_cert'] = client_cert_file_path
0
+ # opts['protocol.http.ssl_config.client_key'] = client_key_file_path
0
+ # opts['protocol.http.ssl_config.ca_file'] = ca_cert_file_path
0
+ # client = ActionWebService::Client::Soap.new(api, 'https://some/service', :driver_options => opts)
0
       def initialize(api, endpoint_uri, options={})
0
         super(api, endpoint_uri)
0
         @type_namespace = options[:type_namespace] || 'urn:ActionWebService'
0
         @method_namespace = options[:method_namespace] || 'urn:ActionWebService'
0
+ @driver_options = options[:driver_options] || {}
0
         @marshaler = WS::Marshaling::SoapMarshaler.new @type_namespace
0
         @encoder = WS::Encoding::SoapRpcEncoding.new @method_namespace
0
         @soap_action_base = options[:soap_action_base]
0
         @soap_action_base ||= URI.parse(endpoint_uri).path
0
         @driver = create_soap_rpc_driver(api, endpoint_uri)
0
+ @driver_options.each do |name, value|
0
+ @driver.options[name.to_s] = value.to_s
0
+ end
0
       end
0
 
0
       protected

Comments

    No one has commented yet.