Accessing BasicAuth? protected WSDL
Q
The following script raises BasicAuth? error.
require 'soap/wsdlDriver' WSDL_URL = 'http://my_server_address/ews/services.wsdl' s = SOAP::WSDLDriverFactory.new(WSDL_URL).create_rpc_driver s.options['protocol.http.basic_auth'] << [WSDL_URL, 'my_user_name', 'my_pass']
A
It's too late that setting basic_auth parameter through 's.options' after creating driver. You need to create soap/property file to set the basic_auth param.
% cat soap/property client.protocol.http.basic_auth.1.url = http://server/url client.protocol.http.basic_auth.1.userid = my_user_name client.protocol.http.basic_auth.1.password = my_pass % ruby -I. test_client.rb
'soap/property' must be located somewhere on $LOAD_PATH so you may need to add '-I' as a command line option of ruby.